mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-21 23:26:56 +00:00
librange.GetRangeSlot via GetActionInfo + GetMacroSpell
Replaces the texture-from-action + "no macro text" heuristic with a proper resolve-to-spellID step. Macros that cast a 40y heal but display a non-spell icon (custom macro icon, /castsequence wrappers, etc.) now match correctly — the previous code missed them because GetActionTexture returns the macro's icon, not the underlying spell's. C_Spell.GetSpellTexture(spellID) returns the spell's intrinsic icon path, which is what the class-spell table is keyed on, so the texture-comparison logic is unchanged.
This commit is contained in:
+18
-4
@@ -135,10 +135,24 @@ end
|
||||
function librange:GetRangeSlot()
|
||||
if not spells[class] then return nil end
|
||||
for i=1,120 do
|
||||
local texture = GetActionTexture(i)
|
||||
if texture and not GetActionText(i) then
|
||||
for _, check in pairs(spells[class]) do
|
||||
if check == texture then return i end
|
||||
-- Resolve the slot to a spellID for both spell and macro actions; the old
|
||||
-- `not GetActionText` macro-filter missed macros that cast a 40y heal but
|
||||
-- displayed a non-spell icon. C_Spell.GetSpellTexture(spellID) gives the
|
||||
-- spell's *intrinsic* icon, which is what we match against.
|
||||
local kind, id = GetActionInfo(i)
|
||||
local spellID
|
||||
if kind == "spell" then
|
||||
spellID = id
|
||||
elseif kind == "macro" then
|
||||
local _, _, sid = GetMacroSpell(id)
|
||||
spellID = sid
|
||||
end
|
||||
if spellID then
|
||||
local texture = C_Spell.GetSpellTexture(spellID)
|
||||
if texture then
|
||||
for _, check in pairs(spells[class]) do
|
||||
if check == texture then return i end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user