-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdepositAnimaIntoBankButton.lua
43 lines (33 loc) · 1.15 KB
/
depositAnimaIntoBankButton.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
-------------------------------------------------------------------------------
-- init
if aura_env.button == nil then
local button = CreateFrame("Button")
local buttonScript = function()
for bag = 0, NUM_BAG_SLOTS do
for slot = 1, GetContainerNumSlots(bag) do
local itemId = GetContainerItemID(bag,slot)
if itemId and C_Item.IsAnimaItemByID(itemId) then
UseContainerItem(bag, slot)
end
end
end
end
button:RegisterForClicks("LeftButtonDown", "RightButtonDown")
button:SetScript("OnClick", buttonScript)
button:SetParent(aura_env.region)
button:SetAllPoints()
local highlight = button:CreateTexture(nil, "HIGHLIGHT")
highlight:SetAllPoints()
highlight:SetColorTexture(1, 1, 1, 0.2)
aura_env.button = button
end
-------------------------------------------------------------------------------
-- trigger: BANKFRAME_OPENED, BANKFRAME_CLOSED
function(event)
return event == "BANKFRAME_OPENED"
end
-------------------------------------------------------------------------------
-- untrigger
function()
return true
end