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 92332f8 commit cf5d17f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions WeakAuras/WeakAuras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4377,6 +4377,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 cf5d17f

Please sign in to comment.