vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | --[[ |
2 | BagnonForever |
||
3 | Adds offline and bank viewing to Bagnon |
||
4 | --]] |
||
5 | |||
6 | function BagnonForever_OnLoad() |
||
7 | BagnonFrame_OnDoubleClick = function(frame) |
||
8 | if(arg1 == "LeftButton") then |
||
9 | BagnonForeverMenu_Show(frame); |
||
10 | end |
||
11 | end; |
||
12 | this:RegisterEvent("BANKFRAME_OPENED"); |
||
13 | end |
||
14 | |||
15 | function BagnonForever_OnEvent(event) |
||
16 | if(event == "BANKFRAME_OPENED") then |
||
17 | --switch to the current character at the bank |
||
18 | if(Banknon) then |
||
19 | BagnonForever_ChangeCharacter(Banknon, UnitName("player")); |
||
20 | end |
||
21 | end |
||
22 | end |
||
23 | |||
24 | --switch to view a different character |
||
25 | function BagnonForever_ChangeCharacter(frame, character) |
||
26 | local frameTitle = getglobal(frame:GetName() .. "Title"); |
||
27 | |||
28 | frameTitle:SetText( string.format(frame.title, character ) ); |
||
29 | frame.player = character |
||
30 | |||
31 | BagnonFrame_UnhighlightAll(frame); |
||
32 | BagnonFrame_GenerateFrame(frame); |
||
33 | |||
34 | local bags = { getglobal(frame:GetName() .. "Bags"):GetChildren() }; |
||
35 | for bag in bags do |
||
36 | BagnonBag_UpdateTexture(frame, bags[bag]:GetID()); |
||
37 | end |
||
38 | |||
39 | if(frame == Banknon) then |
||
40 | Banknon_UpdatePurchaseButtonVis(); |
||
41 | end |
||
42 | end |
||
43 | |||
44 | --money frame tooltips, overriden from BagnonFrame |
||
45 | --Displays the total funds for all characters |
||
46 | function BagnonFrameMoney_OnEnter() |
||
47 | local realm = GetRealmName(); |
||
48 | local money = 0; |
||
49 | |||
50 | if( this:GetLeft() > ( UIParent:GetRight() / 2) ) then |
||
51 | GameTooltip:SetOwner(this, "ANCHOR_LEFT"); |
||
52 | else |
||
53 | GameTooltip:SetOwner(this, "ANCHOR_RIGHT"); |
||
54 | end |
||
55 | |||
56 | GameTooltip:SetText( string.format(BAGNON_FOREVER_MONEY_ON_REALM, realm) ); |
||
57 | |||
58 | for player in BagnonDB[realm] do |
||
59 | if( BagnonDB[realm][player].g ) then |
||
60 | money = money + BagnonDB[realm][player].g; |
||
61 | end |
||
62 | end |
||
63 | |||
64 | SetTooltipMoney(GameTooltip, money); |
||
65 | GameTooltip:Show(); |
||
66 | end |