addonbuttons: add option to hide on combat start

This commit is contained in:
jmgibson1981
2025-02-14 22:43:11 +01:00
committed by GitHub
parent 7d5b741009
commit 44b76727e0
3 changed files with 14 additions and 0 deletions
+12
View File
@@ -49,6 +49,18 @@ pfUI:RegisterModule("addonbuttons", "vanilla:tbc", function ()
end
end)
-- hide flyout frame when entering combat
local pfUIAddonButtonHide = CreateFrame("Frame", nil, UIParent)
pfUIAddonButtonHide:RegisterEvent('PLAYER_REGEN_DISABLED')
pfUIAddonButtonHide:SetScript("OnEvent", function()
local enabled = C.appearance.minimap.addon_buttons == "1"
if enabled then
if pfUI.addonbuttons:IsShown() then
pfUI.addonbuttons:Hide()
end
end
end)
pfUI.addonbuttons.buttons = {}
pfUI.addonbuttons.overrides = {}
pfUI.addonbuttons.last_updated = 0