Skip to content

Commit

Permalink
Attempt to fix the queue pop not showing due to Lua error in a strang…
Browse files Browse the repository at this point in the history
…e scenario
  • Loading branch information
linaori committed Jul 21, 2022
1 parent 77de9ee commit 87f7f21
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions QueueTools.lua
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,10 @@ end

function Private.RestoreEntryButton()
local button = _G.PVPReadyDialogEnterBattleButton
button:SetEnabled(true)
button:SetText(Memory.disableEntryButtonOriginalText)
if not button:IsEnabled() and button:GetText() == L['Hold Shift'] then
button:SetEnabled(true)
button:SetText(Memory.disableEntryButtonOriginalText)
end

if Memory.disableEntryButtonTicker == nil then return end

Expand All @@ -508,6 +510,7 @@ function Private.DisableEntryButton()
if Memory.disableEntryButtonTicker then return end

local button = _G.PVPReadyDialogEnterBattleButton
if not button:IsEnabled() then return end
button:SetEnabled(false)
button:SetText(L['Hold Shift'])

Expand Down Expand Up @@ -638,8 +641,6 @@ function Private.DetectQueuePop(previousState, newState)

ForEachUnitData(function(data) data.battlegroundStatus = BattlegroundStatus.Waiting end)

-- failsafe
Private.RestoreEntryButton()
Private.RefreshPlayerTable()
end

Expand All @@ -649,6 +650,7 @@ function Private.DetectQueueEntry(previousState, newState)

ForEachPlayerData(function(data) data.battlegroundStatus = BattlegroundStatus.None end)

Private.RestoreEntryButton()
Private.RefreshPlayerTable()
end

Expand Down

0 comments on commit 87f7f21

Please sign in to comment.