X-Git-Url: https://www.aleksib.fi/git/wowui.git/blobdiff_plain/f2f73f67a5bb65ef1d0250d964c3945ea8f236c7..ad67f41cf4019dca1e2ea587019fe825f92fdcf0:/OmaRF/RaidFrame.lua diff --git a/OmaRF/RaidFrame.lua b/OmaRF/RaidFrame.lua index 2adcdb9..5d94ff0 100644 --- a/OmaRF/RaidFrame.lua +++ b/OmaRF/RaidFrame.lua @@ -5,9 +5,10 @@ local format = string.format; local UnitInRange = UnitInRange; local InCombatLockdown = InCombatLockdown; local CreateFrame, RegisterStateDriver, RegisterUnitWatch = CreateFrame, RegisterStateDriver, RegisterUnitWatch; +local CTimerAfter = C_Timer.After; local STANDARD_TEXT_FONT = STANDARD_TEXT_FONT; -local GameTooltip = nil; -local GameTooltip_SetDefaultAnchor = nil; +local GameTooltip = GameTooltip; +local GameTooltip_SetDefaultAnchor = GameTooltip_SetDefaultAnchor; local registerEvents = OmaRFEvents.RegisterEvents; local registerUnitEvents = OmaRFEvents.RegisterUnitEvents; @@ -272,9 +273,6 @@ local function initializeFocus(parent) end local function initialize() - -- let other addons hook these to anchor tooltip elsewhere - GameTooltip = _G["GameTooltip"]; - GameTooltip_SetDefaultAnchor = _G["GameTooltip_SetDefaultAnchor"]; _, class = UnitClass("player"); anchorX, anchorY = Settings.Character.AnchorX, Settings.Character.AnchorY; attributes = Settings.Character.Clickheal; @@ -333,16 +331,25 @@ local function hideBlizzardRaid() end end +local function updateTooltipFuncs() + -- let MoveAnything hook these to anchor tooltip elsewhere + GameTooltip = _G["GameTooltip"]; + GameTooltip_SetDefaultAnchor = _G["GameTooltip_SetDefaultAnchor"]; +end + CFrame:RegisterEvent("PLAYER_LOGIN"); +CFrame:RegisterEvent("PLAYER_ENTERING_WORLD"); CFrame:RegisterEvent("PLAYER_REGEN_ENABLED"); CFrame:SetScript("OnEvent", function(self, event, addon) - if event == "PLAYER_LOGIN" then - OmaRFLoadChar(); - hideBlizzardRaid(); - initialize(); - elseif event == "PLAYER_REGEN_ENABLED" then + if event == "PLAYER_REGEN_ENABLED" then -- if CompactRaidFrameManager_UpdateOptionsFlowContainer was called in combat -- couldn't hide the button hideBlizzardRaidButton(); + elseif event == "PLAYER_ENTERING_WORLD" then + CTimerAfter(0.01, updateTooltipFuncs); + elseif event == "PLAYER_LOGIN" then + OmaRFLoadChar(); + hideBlizzardRaid(); + initialize(); end end);