Skip to content

Commit

Permalink
Merged deserter into status column to reduce space usage
Browse files Browse the repository at this point in the history
  • Loading branch information
linaori committed Jul 26, 2022
1 parent 3583bf1 commit 76be75d
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 32 deletions.
1 change: 1 addition & 0 deletions Config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ local AddonName, Namespace = ...

local pairs = pairs
local concat = table.concat
local format = string.format

Namespace.Config = {}

Expand Down
2 changes: 2 additions & 0 deletions Locales/deDE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ L['Hold Shift'] = true
L['Disable Entry Button on Cancel'] = true
L['Disables the entry button when the group leader cancels entry, hold shift to re-enable the button'] = true
L['Show or hide the Battleground Commander group information window'] = true
L['Queue Pop'] = true
L['OK'] = true

L['Open World'] = true
L['Alterac Valley'] = true
Expand Down
2 changes: 2 additions & 0 deletions Locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ L['Hold Shift'] = true
L['Disable Entry Button on Cancel'] = true
L['Disables the entry button when the group leader cancels entry, hold shift to re-enable the button'] = true
L['Show or hide the Battleground Commander group information window'] = true
L['Queue Pop'] = true
L['OK'] = true

L['Open World'] = true
L['Alterac Valley'] = true
Expand Down
2 changes: 2 additions & 0 deletions Locales/ruRU.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ L['Hold Shift'] = true
L['Disable Entry Button on Cancel'] = true
L['Disables the entry button when the group leader cancels entry, hold shift to re-enable the button'] = true
L['Show or hide the Battleground Commander group information window'] = true
L['Queue Pop'] = true
L['OK'] = true

L['Open World'] = true
L['Alterac Valley'] = true
Expand Down
52 changes: 20 additions & 32 deletions QueueTools.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,27 +63,22 @@ local tableStructure = {
},
{
name = '',
width = 100,
width = 120,
align = 'LEFT',
},
{
name = L['Auto Queue'],
width = 40,
width = 45,
align = 'CENTER',
},
{
name = ' ' .. L['Merc'],
width = 40,
align = 'CENTER',
},
{
name = ' ' .. L['Deserter'],
width = 50,
align = 'CENTER',
},
{
name = ' ' .. L['Status'],
width = 50,
width = 75,
align = 'CENTER',
}
}
Expand Down Expand Up @@ -266,31 +261,17 @@ function Private.CreateTableRow(index, data)
end,
}

local deserterColumn = {
value = function(tableData, _, realRow, column)
local columnData = tableData[realRow].cols[column]
Private.TriggerDeserterUpdate(data)

local timeDiff = TimeDiff(data.deserterExpiry, GetTime())
if timeDiff.fullSeconds < 1 then
columnData.color = ColorList.Good
return L['no']
end

columnData.color = ColorList.Bad
return format('%dm', timeDiff.fullMinutes)
end,
}

local readyCheckColumn = {
value = function(tableData, _, realRow, column)
local columnData = tableData[realRow].cols[column]
local readyState = data.readyState
local battlegroundStatus = data.battlegroundStatus
Private.TriggerDeserterUpdate(data)

if battlegroundStatus == BattlegroundStatus.Declined then
columnData.color = nil
return L['Declined']
local timeDiff = TimeDiff(data.deserterExpiry, GetTime())
if timeDiff.fullSeconds > 0 then
columnData.color = ColorList.Bad
return format('%dm', timeDiff.fullMinutes) .. ' ' .. L['Deserter']
end

if battlegroundStatus == BattlegroundStatus.Entered then
Expand All @@ -308,13 +289,21 @@ function Private.CreateTableRow(index, data)
return L['Ready']
end

if readyState == ReadyCheckState.Waiting or battlegroundStatus == BattlegroundStatus.Waiting then
columnData.color = ColorList.Warning
return '...'
if battlegroundStatus == BattlegroundStatus.Declined then
columnData.color = nil
return L['Declined']
end

columnData.color = nil
return '-'
if readyState == ReadyCheckState.Waiting then
return L['Ready Check']
end

if battlegroundStatus == BattlegroundStatus.Waiting then
return L['Queue Pop']
end

return L['OK']
end,
}

Expand All @@ -323,7 +312,6 @@ function Private.CreateTableRow(index, data)
nameColumn,
autoAcceptRoleColumn,
mercenaryColumn,
deserterColumn,
readyCheckColumn,
}, originalData = data }
end
Expand Down

0 comments on commit 76be75d

Please sign in to comment.