mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
2ce4d11698
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).
53 lines
1.3 KiB
Lua
53 lines
1.3 KiB
Lua
--[[
|
|
Author: Dennis Werner Garske (DWG) / brian / Mewtiny
|
|
License: MIT License
|
|
]]
|
|
local _G = _G or getfenv(0)
|
|
local CleveRoids = _G.CleveRoids or {}
|
|
|
|
local CreateFrames = nil
|
|
|
|
local Extension = CleveRoids.RegisterExtension("NotGrid")
|
|
|
|
function Extension.OnEnter()
|
|
CleveRoids.SetMouseoverFrom("ngrid", this.unit)
|
|
end
|
|
|
|
function Extension.OnLeave()
|
|
CleveRoids.ClearMouseoverFrom("ngrid")
|
|
CleveRoids.ClearMouseoverFrom("native")
|
|
end
|
|
|
|
function CleveRoids:NotGrid_CreateFrames()
|
|
CreateFrames(NotGrid); -- call the original
|
|
|
|
-- NotGrid stores all of it's frames in the NotGrid.UnitFrames table.
|
|
for k, frame in pairs(NotGrid.UnitFrames) do
|
|
local enter = frame:GetScript("OnEnter")
|
|
local leave = frame:GetScript("OnLeave")
|
|
|
|
frame:SetScript("OnEnter", function()
|
|
enter()
|
|
Extension.OnEnter()
|
|
end)
|
|
|
|
frame:SetScript("OnLeave", function()
|
|
leave()
|
|
Extension.OnLeave()
|
|
end)
|
|
end
|
|
end
|
|
|
|
function Extension.OnLoad()
|
|
-- NotGrid loads before CleveRoids, so if NotGrid is enabled, then it's global will exist.
|
|
if not NotGrid then
|
|
return
|
|
end
|
|
-- Hooking manually as we need a post hook.
|
|
CreateFrames = NotGrid.CreateFrames
|
|
NotGrid.CreateFrames = CleveRoids.NotGrid_CreateFrames
|
|
|
|
end
|
|
|
|
EventUtil.ContinueOnAddOnLoaded("NotGrid", Extension.OnLoad)
|