From 8abdcfa0fd6d77dc57e89508981dbc5777b812a9 Mon Sep 17 00:00:00 2001 From: Permok Date: Fri, 26 Jul 2024 12:19:15 +0200 Subject: [PATCH] Fix actionbars not loading --- ImprovedTalentLoadouts.lua | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/ImprovedTalentLoadouts.lua b/ImprovedTalentLoadouts.lua index 9878214..6eccb96 100644 --- a/ImprovedTalentLoadouts.lua +++ b/ImprovedTalentLoadouts.lua @@ -1868,7 +1868,7 @@ function TalentLoadouts:LoadActionBar(actionBars, name) local pickedUp = false ClearCursor() if slotInfo.type == "spell" and (currentType ~= "spell" or slotInfo.id ~= currentID) then - PickupSpell(slotInfo.id) + C_Spell.PickupSpell(slotInfo.id) pickedUp = true elseif slotInfo.type == "macro" then if slotInfo.macroType and self[slotInfo.macroType] and not self.duplicates[slotInfo.macroName] then @@ -1889,19 +1889,19 @@ function TalentLoadouts:LoadActionBar(actionBars, name) elseif slotInfo.type == "summonmount" then local _, spellID = C_MountJournal.GetMountInfoByID(slotInfo.id) if spellID then - PickupSpell(spellID) + C_Spell.PickupSpell(spellID) else C_MountJournal.Pickup(0) end pickedUp = true elseif slotInfo.type == "companion" then - PickupSpell(slotInfo.id) + C_Spell.PickupSpell(slotInfo.id) pickedUp = true elseif slotInfo.type == "flyout" then - PickupSpellBookItem(self.flyouts[slotInfo.id], BOOKTYPE_SPELL) + C_SpellBook.PickupSpellBookItem(self.flyouts[slotInfo.id], Enum.SpellBookSpellBank.Player) pickedUp = true elseif slotInfo.type == "item" then - PickupItem(slotInfo.id) + C_Item.PickupItem(slotInfo.id) pickedUp = true end @@ -3974,7 +3974,17 @@ end function TalentLoadouts:UpdateKnownFlyouts() self.flyouts = {} - if GetNumSpellTabs then + if C_SpellBook and C_SpellBook.GetSpellBookItemType then + for skillLineIndex = 1, C_SpellBook.GetNumSpellBookSkillLines() do + local skillLineInfo = C_SpellBook.GetSpellBookSkillLineInfo(skillLineIndex) + for i = 1, skillLineInfo.numSpellBookItems do + local itemType, id, spellID = C_SpellBook.GetSpellBookItemType(i + skillLineInfo.itemIndexOffset, Enum.SpellBookSpellBank.Player); + if itemType and itemType == Enum.SpellBookItemType.Flyout then + self.flyouts[id] = i + skillLineInfo.itemIndexOffset + end + end + end + elseif GetNumSpellTabs then for i = 1, GetNumSpellTabs() do local offset, numSpells, _, offSpecID = select(3, GetSpellTabInfo(i)); if offSpecID == 0 then @@ -3986,18 +3996,6 @@ function TalentLoadouts:UpdateKnownFlyouts() end end end - elseif C_SpellBook then - for i = 1, C_SpellBook.GetNumSpellBookSkillLines() do - local skillLineInfo = C_SpellBook.GetSpellBookSkillLineInfo(i) - if skillLineInfo then - for i = 1, skillLineInfo.numSpellBookItems do - local itemType, id, spellID = C_SpellBook.GetSpellBookItemType(i + skillLineInfo.itemIndexOffset, Enum.SpellBookSpellBank.Player); - if itemType and itemType == Enum.SpellBookItemType.Flyout then - self.flyouts[id] = slotId - end - end - end - end end end SLASH_IMPROVEDTALENDLOADOUTS1 = '/itl'