
Error on Change name/Icon
speedwaystar opened this issue ยท 2 comments
4x MacroToolkit/modules/popupframe.lua:416: attempt to perform arithmetic on local 'offset' (a nil value)
[MacroToolkit/modules/popupframe.lua]:416: in function 'RefreshPlayerSpellIconInfo'
[MacroToolkit/modules/popupframe.lua]:39: in function <MacroToolkit/modules/popupframe.lua:38>
[MacroToolkit/modules/popupframe.lua]:156: in function 'CreateMTPopup'
[MacroToolkit/modules/mainframe.lua]:683: in function <MacroToolkit/modules/mainframe.lua:681>
non-Classic-friendly fix (from line 407 in popupframe.lua)
function MT:RefreshPlayerSpellIconInfo()
--if MT.MACRO_ICON_FILENAMES then return end
-- We need to avoid adding duplicate spellIDs from the spellbook tabs for your other specs.
local activeIcons = {}
local spellBank = Enum and Enum.SpellBookSpellBank and Enum.SpellBookSpellBank.Player or "player";
for i = 1, C_SpellBook.GetNumSpellBookSkillLines() do
local _, _, offset, numSpells
local skillLineInfo = C_SpellBook.GetSpellBookSkillLineInfo(i)
offset = skillLineInfo.itemIndexOffset or 0
numSpells = skillLineInfo.numSpellBookItems or 0
if not numSpells or numSpells == 0 then
numSpells = C_SpellBook.GetNumSpellBookItems(i) or 0
end
offset = offset + 1
local tabEnd = offset + numSpells
for j = offset, tabEnd - 1 do
--to get spell info by slot, you have to pass in a pet argument
local spellType, ID = C_SpellBook.GetSpellBookItemInfo(j, spellBank);
if (spellType ~= "FUTURESPELL") then
local fileID = C_SpellBook.GetSpellBookItemTexture(j, spellBank)
if (fileID) then
activeIcons[fileID] = true
end
end
if (spellType == "FLYOUT") then
local _, _, numSlots, isKnown = GetFlyoutInfo(ID)
if (isKnown and numSlots > 0) then
for k = 1, numSlots do
local spellID, overrideSpellID, isKnown = GetFlyoutSlotInfo(ID, k)
if (isKnown) then
local fileID = C_Spell.GetSpellTexture(spellID)
if (fileID) then
activeIcons[fileID] = true
end
end
end
end
end
end
end