mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
9bebbbb836
Refactor mouseover extensions to split initialization into two phases: OnLoad (empty) and OnAddOnLoad (actual setup). This ensures hooks are only registered when the target addon's globals are defined. Add guard clauses to check for required functions before hooking. Also remove Cursive's premature initialization attempt.
29 lines
801 B
Lua
29 lines
801 B
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("sRaidFrames")
|
|
|
|
function Extension:OnEnter(frame)
|
|
CleveRoids.SetMouseoverFrom("sraid", frame.unit)
|
|
end
|
|
|
|
function Extension.OnLeave()
|
|
CleveRoids.ClearMouseoverFrom("sraid")
|
|
CleveRoids.ClearMouseoverFrom("native")
|
|
end
|
|
|
|
function Extension.OnLoad() end
|
|
|
|
function Extension.OnAddOnLoad()
|
|
if not sRaidFrames then return end
|
|
Extension.HookMethod(sRaidFrames, "UnitTooltip", "OnEnter")
|
|
Extension.HookMethod(_G["GameTooltip"], "Hide", "OnLeave")
|
|
Extension.HookMethod(_G["GameTooltip"], "FadeOut", "OnLeave")
|
|
end
|
|
|
|
EventUtil.ContinueOnAddOnLoaded("sRaidFrames", Extension.OnAddOnLoad)
|