-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbOpenBags.lua
85 lines (72 loc) · 1.92 KB
/
bOpenBags.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
local OpenAllBags = OpenAllBags
local CloseBackPack = CloseBackPack
local CloseBag = CloseBag
local bOB = CreateFrame"Frame"
bOB:RegisterEvent("PLAYER_LOGIN")
bOB:SetScript("OnEvent", function(self, event, ...)
if self[event] then
return self[event](self, event, ...)
end
end)
function bOB:PLAYER_LOGIN()
self:RegisterEvent("AUCTION_HOUSE_SHOW")
self:RegisterEvent("BANKFRAME_OPENED")
self:RegisterEvent("GUILDBANKFRAME_OPENED")
self:RegisterEvent("MAIL_SHOW")
self:RegisterEvent("MERCHANT_SHOW")
self:RegisterEvent("TRADE_SHOW")
self:RegisterEvent("TRADE_SKILL_SHOW")
end
function bOB:YesBlockTrades(block)
SetCVar("BlockTrades", block and 1 or 0)
end
--[[ FrameXML/ContainerFrame.lua ]]--
function bOB:closeAllBags()
CloseBackpack()
for i=1, NUM_CONTAINER_FRAMES, 1 do
CloseBag(i)
end
end
function bOB:AUCTION_HOUSE_SHOW()
OpenAllBags(true)
self:YesBlockTrades(true)
self:RegisterEvent("AUCTION_HOUSE_CLOSED")
end
function bOB:BANKFRAME_OPENED()
OpenAllBags(true)
self:YesBlockTrades(true)
self:RegisterEvent("BANKFRAME_CLOSED")
end
function bOB:GUILDBANKFRAME_OPENED()
OpenAllBags(true)
self:YesBlockTrades(true)
self:RegisterEvent("GUILDBANKFRAME_CLOSED")
end
function bOB:MAIL_SHOW()
OpenAllBags(true)
self:YesBlockTrades(true)
self:RegisterEvent("MAIL_CLOSED")
end
function bOB:MERCHANT_SHOW()
OpenAllBags(true)
self:YesBlockTrades(true)
self:RegisterEvent("MERCHANT_CLOSED")
end
function bOB:TRADE_SHOW()
OpenAllBags(true)
self:RegisterEvent("TRADE_CLOSED")
end
function bOB:TRADE_SKILL_SHOW()
OpenAllBags(true)
self:RegisterEvent("TRADE_SKILL_CLOSE")
end
function bOB:MERCHANT_CLOSED()
self:closeAllBags()
self:YesBlockTrades(false)
end
bOB.AUCTION_HOUSE_CLOSED = bOB.MERCHANT_CLOSED
bOB.BANKFRAME_CLOSED = bOB.MERCHANT_CLOSED
bOB.GUILDBANKFRAME_CLOSED = bOB.MERCHANT_CLOSED
bOB.MAIL_CLOSED = bOB.MERCHANT_CLOSED
bOB.TRADE_CLOSED = bOB.MERCHANT_CLOSED
bOB.TRADE_SKILL_CLOSE = bOB.MERCHANT_CLOSED