Files
SuperCleveRoidMacros/Extensions/Mouseover/CT_RaidAssist.lua
T
Brues 2ce4d11698 Use ClassicAPI EventUtil for addon-load/login extension wiring
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).
2026-07-26 14:53:34 -05:00

58 lines
1.4 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_RaidAssist")
function Extension.OnEnter()
local tempOptions = CT_RAMenu_Options["temp"]
if ( SpellIsTargeting() ) then
SetCursor("CAST_CURSOR")
end
local parent = this.frameParent
local id = parent.id
if ( strsub(parent.name, 1, 12) == "CT_RAMTGroup" ) then
local name
if ( CT_RA_MainTanks[id] ) then
name = CT_RA_MainTanks[id]
end
for i = 1, GetNumRaidMembers(), 1 do
local memberName = GetRaidRosterInfo(i)
if ( name == memberName ) then
id = i
break
end
end
elseif ( strsub(parent.name, 1, 12) == "CT_RAPTGroup" ) then
local name
if ( CT_RA_PTargets[id] ) then
name = CT_RA_PTargets[id]
end
for i = 1, GetNumRaidMembers(), 1 do
local memberName = GetRaidRosterInfo(i)
if ( name == memberName ) then
id = i
break
end
end
end
CleveRoids.SetMouseoverFrom("ctra", "raid"..id)
end
function Extension.OnLeave()
CleveRoids.ClearMouseoverFrom("ctra")
CleveRoids.ClearMouseoverFrom("native")
end
function Extension.OnLoad()
Extension.Hook("CT_RA_MemberFrame_OnEnter", "OnEnter")
Extension.HookMethod(_G["GameTooltip"], "Hide", "OnLeave")
Extension.HookMethod(_G["GameTooltip"], "FadeOut", "OnLeave")
end
EventUtil.ContinueOnAddOnLoaded("CT_RaidAssist", Extension.OnLoad)