vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 --[[
2 Bagnon_Overrides
3 Function Overrides
4 Yeah I know the formatting doesn't resemble my normal formatting
5  
6 OpenBackpack, and CloseBackPack are called automatically
7 --]]
8  
9 local function Bagnon_BagIsControlledByBagnon(id)
10 return Bagnon_IsAddOnEnabled("Bagnon") and ( (not BagnonSets["Bagnon"] and Bagnon_IsInventoryBag(id) ) or Bagnon_FrameHasBag("Bagnon", id) );
11 end
12  
13 local bToggleBag = ToggleBag;
14 ToggleBag = function(id)
15 --bag slots
16 if( Bagnon_BagIsControlledByBagnon(id) ) then
17 BagnonFrame_Toggle("Bagnon");
18 --bank slots
19 elseif( BagnonSets.showBankAtBank and Bagnon_IsAddOnEnabled("Banknon") and Bagnon_FrameHasBag("Banknon", id) ) then
20 return;
21 --the blizzard way
22 else
23 bToggleBag(id);
24 end
25 end
26  
27 local bToggleBackpack = ToggleBackpack;
28 ToggleBackpack = function()
29 if( Bagnon_IsAddOnEnabled("Bagnon") ) then
30 BagnonFrame_Toggle("Bagnon");
31 else
32 bToggleBackpack();
33 end
34 end
35  
36 local bOpenBag = OpenBag;
37 OpenBag = function(id)
38 if( Bagnon_BagIsControlledByBagnon(id) ) then
39 BagnonFrame_Open("Bagnon", 1);
40 else
41 bOpenBag(id);
42 end
43 end
44  
45 local bCloseBag = CloseBag;
46 CloseBag = function(id)
47 if( Bagnon_BagIsControlledByBagnon(id) ) then
48 BagnonFrame_Close("Bagnon", 1);
49 else
50 bCloseBag(id);
51 end
52 end
53  
54 local bOpenBackpack = OpenBackpack;
55 OpenBackpack = function()
56 if( Bagnon_IsAddOnEnabled("Bagnon") ) then
57 BagnonFrame_Open("Bagnon", 1);
58 else
59 bOpenBackpack();
60 end
61 end
62  
63 local bCloseBackpack = CloseBackpack;
64 CloseBackpack = function()
65 if( Bagnon_IsAddOnEnabled("Bagnon") ) then
66 BagnonFrame_Close("Bagnon", 1);
67 else
68 bCloseBackpack();
69 end
70 end
71  
72 --OpenAllBags is actually a toggle
73 local bOpenAllBags = OpenAllBags;
74 OpenAllBags = function(forceOpen)
75 if( Bagnon_IsAddOnEnabled("Bagnon") ) then
76 BagnonFrame_Toggle("Bagnon");
77 else
78 bOpenAllBags(forceOpen);
79 end
80 end
81  
82 local bCloseAllBags = CloseAllBags;
83 CloseAllBags = function()
84 if( Bagnon_IsAddOnEnabled("Bagnon") ) then
85 BagnonFrame_Close("Bagnon");
86 else
87 bCloseAllBags();
88 end
89 end
90  
91 local bToggleKeyring = ToggleKeyRing;
92 ToggleKeyRing = function()
93 if( Bagnon_IsAddOnEnabled("Bagnon") and Bagnon_FrameHasBag("Bagnon", KEYRING_CONTAINER) ) then
94 BagnonFrame_Toggle("Bagnon");
95 else
96 bToggleKeyring();
97 end
98 end