Make Extras ClassicAPI-first

This commit is contained in:
Dusk-92
2026-08-30 11:18:37 +02:00
parent 264ee583c0
commit 5ec909cd56
8 changed files with 47 additions and 77 deletions
+7 -9
View File
@@ -1,6 +1,6 @@
local _G = ShaguTweaks.GetGlobalEnv()
local T = ShaguTweaks.T
local API = ShaguTweaks.API or {}
local API = ShaguTweaks.API
local libspell = ShaguTweaks.libspell
local module = ShaguTweaks:register({
@@ -27,12 +27,10 @@ module.enable = function(self)
end
local function GetMacroData(actionSlot, cache)
if API.GetActionInfo then
local actionType, id = API.GetActionInfo(actionSlot)
if actionType == "macro" and id then
local _, _, body = GetMacroInfo(id)
if body then return id, body end
end
local actionType, id = API.GetActionInfo(actionSlot)
if actionType == "macro" and id then
local _, _, body = GetMacroInfo(id)
if body then return id, body end
end
local macroName = GetActionText(actionSlot)
@@ -83,8 +81,8 @@ module.enable = function(self)
-- ClassicAPI already resolves and caches the macro's primary spell.
-- This is the correct modern behavior for a bare "#showtooltip" line and
-- also covers /castsequence, CastSpellByName and CastSpellNoToggle.
if macroSlot and type(_G.GetMacroSpell) == "function" then
local spell, rank = _G.GetMacroSpell(macroSlot)
if macroSlot then
local spell, rank = API.GetMacroSpell(macroSlot)
if spell then
return spell, rank ~= "" and rank or nil
end