X-Git-Url: https://www.aleksib.fi/git/wowui.git/blobdiff_plain/121eb4ef1f9210e1c70ebc8e101d37f57fbb30a0..6e06bfb151855f946ceb1885d310598e612fa128:/OmaRF/RaidFrame.lua diff --git a/OmaRF/RaidFrame.lua b/OmaRF/RaidFrame.lua index 12ac13f..4259c67 100644 --- a/OmaRF/RaidFrame.lua +++ b/OmaRF/RaidFrame.lua @@ -322,7 +322,15 @@ local function initializeFocus(parent) secure:SetAttribute("_onstate-vehicleui", vehicletoggle); end +local function loadCharSettings() + width, height = Settings.Character.Width, Settings.Character.Height; + anchorX, anchorY = Settings.Character.AnchorX, Settings.Character.AnchorY; + attributes = Settings.Character.Clickheal; + positions = Settings.Character.Positions; +end + local function initialize() + loadCharSettings(); CFrame:SetPoint("CENTER", nil, "CENTER", anchorX, anchorY); CFrame:SetHeight((height+2)*8); CFrame:SetWidth((width+2)*5+1); @@ -331,13 +339,6 @@ local function initialize() initializeFocus(CFrame); end -local function loadCharSettings() - width, height = Settings.Character.Width, Settings.Character.Height; - anchorX, anchorY = Settings.Character.AnchorX, Settings.Character.AnchorY; - attributes = Settings.Character.Clickheal; - positions = Settings.Character.Positions; -end - -- hiding Blizzard frames somewhat based on ShadowedUF local function hideBlizzardRaidButton() if InCombatLockdown() then return end @@ -372,26 +373,30 @@ local function hideBlizzardRaid() CompactRaidFrameContainer:HookScript("OnShow", hide); hooksecurefunc("CompactRaidFrameManager_UpdateOptionsFlowContainer", hideBlizzardRaidButton); hideBlizzardRaidButton(); + + -- hide focus frame + for _, frame in pairs({FocusFrame, FocusFrameToT}) do + frame:UnregisterAllEvents(); + frame.healthbar:UnregisterAllEvents(); + frame.manabar:UnregisterAllEvents(); + if frame.spellbar then frame.spellbar:UnregisterAllEvents() end + if frame.powerBarAlt then frame.powerBarAlt:UnregisterAllEvents() end + frame:Hide(); + end end -CFrame:RegisterEvent("ADDON_LOADED"); CFrame:RegisterEvent("PLAYER_LOGIN"); CFrame:RegisterEvent("PLAYER_REGEN_ENABLED"); CFrame:SetScript("OnEvent", function(self, event, addon) if event == "PLAYER_LOGIN" then + OmaRFLoadChar(); + OmaRFEvents.LoadChar(); + OmaRFIndicators.LoadChar(); hideBlizzardRaid(); initialize(); - elseif event == "ADDON_LOADED" and addon == "Blizzard_CompactRaidFrames" then - -- never really happening unless load order changes - hideBlizzardRaid(); elseif event == "PLAYER_REGEN_ENABLED" then -- if CompactRaidFrameManager_UpdateOptionsFlowContainer was called in combat -- couldn't hide the button hideBlizzardRaidButton(); - elseif event == "ADDON_LOADED" and addon == "OmaRF" then - OmaRFLoadChar(); - loadCharSettings(); - OmaRFEvents.LoadChar(); - OmaRFIndicators.LoadChar(); end end);