Skip to content

Commit

Permalink
hide dynFrame if combat starts with living threads
Browse files Browse the repository at this point in the history
nothing that we put into dynFrame threads is meant for in-combat execution anyways, so to avoid random unexpectedly short timeouts, pause execution if combat starts, and resume after combat ends.

There's potential for WeakAuras to be 'broken' during that combat session (due to dynamic groups being Pause()'d), but we probably couldn't have unbroken it given that ResumeAllDynamicGroups is too costly to call during combat lockdown without risking a timeout.

Fixes WeakAuras#4967 (or at least, reduces its likelihood)
  • Loading branch information
emptyrivers committed May 15, 2024
1 parent 19f1ed6 commit 8080b4c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions WeakAuras/WeakAuras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1668,8 +1668,8 @@ local function scanForLoadsImpl(toCheck, event, arg1, ...)
local encounter_id = WeakAuras.CurrentEncounter and WeakAuras.CurrentEncounter.id or 0

if (event == "ENCOUNTER_START") then
encounter_id = tonumber (arg1)
CreateEncounterTable (encounter_id)
encounter_id = tonumber(arg1)
CreateEncounterTable(encounter_id)
elseif (event == "ENCOUNTER_END") then
encounter_id = 0
DestroyEncounterTable()
Expand Down Expand Up @@ -4380,6 +4380,15 @@ do
end
end
end);
dynFrame.frame:RegisterEvent("PLAYER_REGEN_ENABLED")
dynFrame.frame:RegisterEvent("PLAYER_REGEN_DISABLED")
dynFrame.frame:SetScript("OnEvent", function(self, event)
if event == "PLAYER_REGEN_ENABLED" and self:IsShown() then
self:Hide()
elseif event == "PLAYER_REGEN_DISABLED" and not self:IsShown() and dynFrame.size > 0 then
self:Show()
end
end)
end

Private.dynFrame = dynFrame;
Expand Down

0 comments on commit 8080b4c

Please sign in to comment.