mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
Replace hand-rolled ADDON_LOADED/PLAYER_LOGIN handlers with
EventUtil.ContinueOnAddOnLoaded / ContinueOnPlayerLogin, which fire
immediately if the event already happened -- removing the "we loaded before
the target addon and missed its ADDON_LOADED" workarounds.
- pfUI compat: ContinueOnAddOnLoaded("pfUI") + ContinueOnPlayerLogin; drops
the missed-event fallback (login path still re-runs SetupCompatibility).
- MacroErrorUI / MacroLengthWarn: ContinueOnAddOnLoaded("Blizzard_MacroUI"),
folding their manual "already loaded" checks.
- 9 Mouseover extensions (ag_UnitFrames, CT_RaidAssist, CT_UnitFrames,
DiscordUnitFrames, Grid, NotGrid, Cursive, sRaidFrames, PerfectRaid):
ContinueOnAddOnLoaded("<AddonName>", OnLoad). Since immediate-fire passes no
event args, the old `arg1 == "X"` checks are replaced by the addon-name gate
(global guards kept where present); also removes the buggy
UnregisterEvent("ADDON_LOADED", "Onload") no-ops that never fired.
Addon names match file names; drops support for renamed folders (e.g. -master).
39 lines
1.0 KiB
Lua
39 lines
1.0 KiB
Lua
--[[
|
|
Author: Dennis Werner Garske (DWG) / brian / Mewtiny
|
|
License: MIT License
|
|
]]
|
|
local _G = _G or getfenv(0)
|
|
local CleveRoids = _G.CleveRoids or {}
|
|
|
|
local Extension = CleveRoids.RegisterExtension("CT_UnitFrames")
|
|
|
|
function Extension.SetHook(widget)
|
|
local hookedOnEnter = widget:GetScript("OnEnter")
|
|
local hookedOnLeave = widget:GetScript("OnLeave")
|
|
|
|
widget:SetScript("OnEnter", function()
|
|
hookedOnEnter()
|
|
CleveRoids.SetMouseoverFrom("ctuf", "targettarget")
|
|
end)
|
|
|
|
widget:SetScript("OnLeave", function()
|
|
hookedOnLeave()
|
|
CleveRoids.ClearMouseoverFrom("ctuf")
|
|
CleveRoids.ClearMouseoverFrom("native")
|
|
end)
|
|
end
|
|
|
|
function Extension.OnLoad()
|
|
if not CT_AssistFrame then
|
|
return
|
|
end
|
|
CleveRoids.Print("CT_UnitFrames module loaded.")
|
|
|
|
Extension.SetHook(CT_AssistFrame)
|
|
Extension.SetHook(CT_AssistFrameHealthBar)
|
|
Extension.SetHook(CT_AssistFrameManaBar)
|
|
Extension.SetHook(CT_AssistFrame_Drag)
|
|
end
|
|
|
|
EventUtil.ContinueOnAddOnLoaded("CT_UnitFrames", Extension.OnLoad)
|