-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
22 lines (22 loc) · 867 Bytes
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
local lastChange = 0
local f = CreateFrame("Frame")
f:SetScript('OnEvent', function()
if event == "TRADE_MONEY_CHANGED" or event == "TRADE_PLAYER_ITEM_CHANGED" or event == "TRADE_TARGET_ITEM_CHANGED" then
lastChange = GetTime()
elseif event == "TRADE_SHOW" then
f:SetScript('OnUpdate', function()
if (lastChange + 2) < GetTime() then
TradeFrameTradeButton:Enable()
else
TradeFrameTradeButton:Disable()
end
end)
elseif event == "TRADE_HIDE" then
f:SetScript('OnUpdate', nil)
end
end)
f:RegisterEvent("TRADE_MONEY_CHANGED")
f:RegisterEvent("TRADE_PLAYER_ITEM_CHANGED")
f:RegisterEvent("TRADE_TARGET_ITEM_CHANGED")
f:RegisterEvent("TRADE_SHOW")
f:RegisterEvent("TRADE_HIDE")