vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | function GB_Spellbook_Initialize() |
2 | if (not GB_INITIALIZED) then return; end |
||
3 | GB_SpellBookPrevPageButton:Disable(); |
||
4 | GB_SPELLBOOKPAGE = 0; |
||
5 | GB_SpellBookNextPageButton:Enable(); |
||
6 | GB_Spellbook_UpdatePage(1, 40); |
||
7 | end |
||
8 | |||
9 | function GB_Spellbook_NextPage() |
||
10 | GB_SPELLBOOKPAGE = GB_SPELLBOOKPAGE + 1; |
||
11 | GB_SpellBookPrevPageButton:Enable(); |
||
12 | local start = 40 * GB_SPELLBOOKPAGE + 1; |
||
13 | local finish = start + 39; |
||
14 | GB_Spellbook_UpdatePage(start, finish); |
||
15 | end |
||
16 | |||
17 | function GB_Spellbook_PreviousPage() |
||
18 | GB_SPELLBOOKPAGE = GB_SPELLBOOKPAGE - 1; |
||
19 | GB_SpellBookNextPageButton:Enable(); |
||
20 | if (GB_SPELLBOOKPAGE == 0) then |
||
21 | GB_SpellBookPrevPageButton:Disable(); |
||
22 | end |
||
23 | local start = 40 * GB_SPELLBOOKPAGE + 1; |
||
24 | local finish = start + 39; |
||
25 | GB_Spellbook_UpdatePage(start, finish); |
||
26 | end |
||
27 | |||
28 | function GB_Spellbook_UpdatePage(start, finish) |
||
29 | for x = start, finish do |
||
30 | local boxnum = x - 40 * GB_SPELLBOOKPAGE; |
||
31 | local spellbox = "GB_MiniSpellbook_Spell_"..boxnum; |
||
32 | local spellname, spellrank = GetSpellName(x, "BOOKTYPE_SPELL"); |
||
33 | if (spellname) then |
||
34 | getglobal(spellbox):Show(); |
||
35 | getglobal(spellbox):SetID(x); |
||
36 | local texture = GetSpellTexture(x, "BOOKTYPE_SPELL"); |
||
37 | getglobal(spellbox.."_Texture"):SetTexture(texture); |
||
38 | if (spellrank) then |
||
39 | local rankstart = string.find(spellrank, " "); |
||
40 | if (rankstart) then |
||
41 | local rank = string.sub(spellrank, rankstart + 1); |
||
42 | if (rank ~= "Passive") then |
||
43 | getglobal(spellbox.."_Rank"):SetText(rank); |
||
44 | else |
||
45 | getglobal(spellbox.."_Rank"):SetText(""); |
||
46 | end |
||
47 | else |
||
48 | getglobal(spellbox.."_Rank"):SetText(""); |
||
49 | end |
||
50 | else |
||
51 | getglobal(spellbox.."_Rank"):SetText(""); |
||
52 | end |
||
53 | else |
||
54 | getglobal(spellbox):Hide(); |
||
55 | GB_SpellBookNextPageButton:Disable(); |
||
56 | end |
||
57 | end |
||
58 | end |