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;
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;
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);
local _;
local CreateFrame = CreateFrame;
local UnitAura = UnitAura;
-local GameTooltip = nil;
+local GameTooltip = GameTooltip;
local auraFilters = {"HELPFUL", "HARMFUL"};
frame:SetScript("OnUpdate", nil);
end
+function M.UpdateAuraTooltips()
+ GameTooltip = _G["GameTooltip"];
+end
+
local function createAura(parent, prev, anchor, name, unit)
local aura = CreateFrame("Frame", name, parent);
aura:SetPoint("TOPLEFT", prev, anchor);
- aura:SetWidth(16);
- aura:SetHeight(16);
+ aura:SetWidth(20);
+ aura:SetHeight(20);
aura.icon = aura:CreateTexture(nil, "ARTWORK");
aura.icon:SetAllPoints();
aura.cd = CreateFrame("Cooldown", name.."CD", aura, "CooldownFrameTemplate");
end
function M.CreateAuraFrame(parent, unit)
- GameTooltip = _G["GameTooltip"];
local name = parent:GetName().."Auras";
parent.auras = CreateFrame("Frame", name, parent);
parent.auras:SetPoint("TOPLEFT", parent, "BOTTOMLEFT", 0, -8);
local _;
local unpack, pairs = unpack, pairs;
local format = string.format;
-local GameTooltip = nil;
-local GameTooltip_SetDefaultAnchor = nil;
+local GameTooltip = GameTooltip;
+local GameTooltip_SetDefaultAnchor = GameTooltip_SetDefaultAnchor;
local registerUnitEvents = OmaUFEvents.RegisterUnitEvents;
local registerCastEvents = OmaUFCastBar.RegisterCastEvents;
GameTooltip:FadeOut();
end
+function OmaUnitFrames.UpdateBossTooltips()
+ GameTooltip = _G["GameTooltip"];
+ GameTooltip_SetDefaultAnchor = _G["GameTooltip_SetDefaultAnchor"];
+end
+
local function createFrame(framename, securename, parent, unit, anchorX, anchorY)
local secure = CreateFrame("Button", securename, parent, inheritedFrames);
local frame = CreateFrame("Frame", framename, parent);
secure:SetScript("OnLeave", hideTooltip);
-- set attributes
-- TODO other set of click cast on boss frames possibly
- secure:RegisterForClicks("AnyDown");
- for attr, val in pairs(attributes) do
- secure:SetAttribute(attr, val);
- end
+ --secure:RegisterForClicks("AnyDown");
+ --for attr, val in pairs(attributes) do
+ -- secure:SetAttribute(attr, val);
+ --end
-- rest give target and menu
secure:SetAttribute("*type1", "target");
secure:SetAttribute("*type2", "togglemenu");
- secure:SetAttribute("toggleForVehicle", false);
+ --secure:SetAttribute("toggleForVehicle", false); -- TODO run LFR to see if there's boss1pet or something
RegisterUnitWatch(frame);
RegisterUnitWatch(secure);
+ -- TODO try register visibility state driver with [boss1][boss2][boss3] etc.
end
function OmaUnitFrames.InitializeBoss(parent)
- GameTooltip = _G["GameTooltip"];
- GameTooltip_SetDefaultAnchor = _G["GameTooltip_SetDefaultAnchor"];
attributes = Settings.Character.Clickheal;
createFrame("OmaBoss1", "OmaBossSecure1", parent, "boss1", anchorX, anchorY);
local _;
local unpack, pairs = unpack, pairs;
local format = string.format;
-local GameTooltip = nil;
-local GameTooltip_SetDefaultAnchor = nil;
+local GameTooltip = GameTooltip;
+local GameTooltip_SetDefaultAnchor = GameTooltip_SetDefaultAnchor;
local registerUnitEvents = OmaUFEvents.RegisterUnitEvents;
local unitEvent = OmaUFEvents.UnitEvent;
end
]=]
-function OmaUnitFrames.InitializePet(parent)
+function OmaUnitFrames.UpdatePetTooltips()
GameTooltip = _G["GameTooltip"];
GameTooltip_SetDefaultAnchor = _G["GameTooltip_SetDefaultAnchor"];
+end
+
+function OmaUnitFrames.InitializePet(parent)
attributes = Settings.Character.Clickheal; -- TODO pet clickheal separate with Mend Pet etc.
local secure = CreateFrame("Button", "OmaPetSecure", parent, inheritedFrames);
local _;
local unpack, pairs = unpack, pairs;
local format = string.format;
-local GameTooltip = nil;
-local GameTooltip_SetDefaultAnchor = nil;
+local GameTooltip = GameTooltip;
+local GameTooltip_SetDefaultAnchor = GameTooltip_SetDefaultAnchor;
local registerUnitEvents = OmaUFEvents.RegisterUnitEvents;
local registerCastEvents = OmaUFCastBar.RegisterCastEvents;
end
]=]
-function OmaUnitFrames.InitializePlayer(parent)
+function OmaUnitFrames.UpdatePlayerTooltips()
GameTooltip = _G["GameTooltip"];
GameTooltip_SetDefaultAnchor = _G["GameTooltip_SetDefaultAnchor"];
+end
+
+function OmaUnitFrames.InitializePlayer(parent)
attributes = Settings.Character.Clickheal;
local secure = CreateFrame("Button", "OmaPlayerSecure", parent, inheritedFrames);
local _;
local unpack, pairs = unpack, pairs;
local format = string.format;
-local GameTooltip = nil;
-local GameTooltip_SetDefaultAnchor = nil;
+local GameTooltip = GameTooltip;
+local GameTooltip_SetDefaultAnchor = GameTooltip_SetDefaultAnchor;
local registerUnitEvents = OmaUFEvents.RegisterUnitEvents;
local registerCastEvents = OmaUFCastBar.RegisterCastEvents;
GameTooltip:FadeOut();
end
-function OmaUnitFrames.InitializeTarget(parent)
+function OmaUnitFrames.UpdateTargetTooltips()
GameTooltip = _G["GameTooltip"];
GameTooltip_SetDefaultAnchor = _G["GameTooltip_SetDefaultAnchor"];
+end
+
+function OmaUnitFrames.InitializeTarget(parent)
attributes = Settings.Character.Clickheal;
local secure = CreateFrame("Button", "OmaTargetSecure", parent, inheritedFrames);
local _;
local pairs = pairs;
local InCombatLockdown = InCombatLockdown;
+local CTimerAfter = C_Timer.After;
+
+local updateAuraTooltips = OmaUFAuras.UpdateAuraTooltips;
local UnitFrames = CreateFrame("Frame", "OmaUnitFrames", UIParent);
WarlockPowerFrame, MonkHarmonyBarFrame, PaladinPowerBarFrame,
MageArcaneChargesFrame, CastingBarFrame, PetCastingBarFrame};
for i = 1,MAX_BOSS_FRAMES do
- table.insert(frames, _G["Boss"..i.."TargetFrame"]);
- table.insert(frames, _G["Boss"..i.."TargetFrameHealthBar"]);
- table.insert(frames, _G["Boss"..i.."TargetFrameManaBar"]);
+ --table.insert(frames, _G["Boss"..i.."TargetFrame"]);
+ --table.insert(frames, _G["Boss"..i.."TargetFrameHealthBar"]);
+ --table.insert(frames, _G["Boss"..i.."TargetFrameManaBar"]);
end
for _, frame in pairs(frames) do
frame:UnregisterAllEvents();
end
end
+local function updateTooltipFuncs()
+ -- let MoveAnything hook these to anchor tooltip elsewhere
+ M.UpdatePlayerTooltips();
+ M.UpdatePetTooltips();
+ M.UpdateTargetTooltips();
+ M.UpdateBossTooltips();
+ updateAuraTooltips();
+end
+
UnitFrames:RegisterEvent("PLAYER_LOGIN");
+UnitFrames:RegisterEvent("PLAYER_ENTERING_WORLD");
UnitFrames:RegisterEvent("ADDON_LOADED");
UnitFrames:SetScript("OnEvent", function(self, event, addon)
- if event == "PLAYER_LOGIN" then
+ if event == "PLAYER_ENTERING_WORLD" then
+ CTimerAfter(0.01, updateTooltipFuncs);
+ elseif event == "ADDON_LOADED" and addon == "Blizzard_ArenaUI" then
+ hideArenaFrames();
+ elseif event == "PLAYER_LOGIN" then
OmaUFLoadChar();
hideBlizzardFrames();
initialize();
- elseif event == "ADDON_LOADED" and addon == "Blizzard_ArenaUI" then
- hideArenaFrames();
end
end);