14
14
local MYSLOT_VER = 42
15
15
16
16
-- TWW Beta Compat code (fix and cleanup below later)
17
- local GetNumSpellTabs = C_SpellBook and C_SpellBook .GetNumSpellBookSkillLines or GetNumSpellTabs
18
- local GetSpellTabInfo = C_SpellBook and C_SpellBook .GetSpellBookSkillLineInfo or GetSpellTabInfo
19
- local PickupSpell = C_Spell and C_Spell .PickupSpell or PickupSpell
20
- local PickupItem = C_Item and C_Item .PickupItem or PickupItem
21
- local GetSpellInfo = C_Spell and C_Spell .GetSpellName or GetSpellInfo
22
- local GetSpellLink = C_Spell and C_Spell .GetSpellLink or GetSpellLink
17
+ local GetNumSpellTabs = C_SpellBook and C_SpellBook .GetNumSpellBookSkillLines or _G .GetNumSpellTabs
18
+ local GetSpellTabInfo = (C_SpellBook and C_SpellBook .GetSpellBookSkillLineInfo ) and function (index )
19
+ local skillLineInfo = C_SpellBook .GetSpellBookSkillLineInfo (index );
20
+ if skillLineInfo then
21
+ return skillLineInfo .name ,
22
+ skillLineInfo .iconID ,
23
+ skillLineInfo .itemIndexOffset ,
24
+ skillLineInfo .numSpellBookItems ,
25
+ skillLineInfo .isGuild ,
26
+ skillLineInfo .offSpecID ,
27
+ skillLineInfo .shouldHide ,
28
+ skillLineInfo .specID ;
29
+ end
30
+ end or _G .GetSpellTabInfo
31
+ local PickupSpell = C_Spell and C_Spell .PickupSpell or _G .PickupSpell
32
+ local PickupItem = C_Item and C_Item .PickupItem or _G .PickupItem
33
+ local GetSpellInfo = C_Spell and C_Spell .GetSpellName or _G .GetSpellInfo
34
+ local GetSpellLink = C_Spell and C_Spell .GetSpellLink or _G .GetSpellLink
35
+ local GetSpellBookItemInfo = C_SpellBook and C_SpellBook .GetSpellBookItemType or _G .GetSpellBookItemInfo
23
36
-- TWW Beta Compat End
24
37
25
38
-- local MYSLOT_IS_DEBUG = true
@@ -516,6 +529,8 @@ function MySlot:RecoverData(msg, opt)
516
529
-- {{{ Cache Spells
517
530
-- cache spells
518
531
local spells = {}
532
+
533
+ if SPELLS_PER_PAGE then
519
534
for i = 1 , GetNumSpellTabs () do
520
535
local tab , tabTex , offset , numSpells , isGuild , offSpecID = GetSpellTabInfo (i );
521
536
offSpecID = (offSpecID ~= 0 )
@@ -536,7 +551,9 @@ function MySlot:RecoverData(msg, opt)
536
551
end
537
552
end
538
553
end
554
+ end
539
555
556
+ if BOOKTYPE_PROFESSION then
540
557
if GetProfessions then
541
558
for _ , p in pairs ({ GetProfessions () }) do
542
559
local _ , _ , _ , _ , numSpells , spelloffset = GetProfessionInfo (p )
@@ -550,6 +567,7 @@ function MySlot:RecoverData(msg, opt)
550
567
end
551
568
end
552
569
end
570
+ end
553
571
-- }}}
554
572
555
573
0 commit comments