Skip to content

Commit

Permalink
Fix actionbars not loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Lardeck committed Jul 26, 2024
1 parent 32d1f4f commit 8abdcfa
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions ImprovedTalentLoadouts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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'
Expand Down

0 comments on commit 8abdcfa

Please sign in to comment.