WoWInterface SVN EasyDND

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 63 to Rev 64
    Reverse comparison

Rev 63 → Rev 64

EasyDND/EasyDND.lua
76,6 → 76,8
SetCVar("Sound_EnableSFX", 0)
elseif event == L["Party"] then
_.c = true
elseif event == L["Trade"] then
_.h = true
end
_.x = true
db.anti_counter = db.anti_counter + 1
148,7 → 150,7
return
end
delay = delay + elapsed
if delay > 0.05 then
if delay > 0.01 then
fake:SetScript("OnUpdate",nil)
fake = nil
if rem then _.c = false end
217,6 → 219,8
_.__orig_TradeFrame_OnEvent = TradeFrame:GetScript("OnEvent")
_.__orig_InitiateTrade = InitiateTrade
_.__orig_PlaySound = PlaySound
_.__orig_BankFrame_OnEvent = BankFrame_OnEvent
_.__orig_HideUIPanel = HideUIPanel
_.b = false
end
 
506,7 → 510,7
else
if db.v or db.w or db.u or db.t then
if UnitIsDND("player") then send("", "DND") end
if UnitIsAFK("player") then send("", "AFK") end
if UnitIsAFK("player") and IsIn() ~= "BG" then send("", "AFK") end
elseif _.r or _.a then
if IsIn() == "Instance" or IsIn() == "BG" then
if UnitIsDND("player") then send("", "DND") end
672,16 → 676,49
if db.modebg or db.modeinst then Stub("PLAYER_ENTERING_WORLD") end
end
 
-- Like PlaySound, we should check our trade flag prior allowing this function to Hide the current BankFrame to ensure
-- the trade isn't a blocked one and force the closure of our bank and/or guildbank.
local function __hooked_Bank_OnEvent(self, event, ...)
local delay, _, args, frame = 0, EasyDND, ..., nil
if self then frame = self:GetName() or "none" end
if event == "BANKFRAME_CLOSED" or ( frame and frame == "GuildBankFrame" ) then
local fake = CreateFrame("Frame", nil, UIParent)
fake:SetScript("OnUpdate", function(a, elapsed)
if _.h then
_.h = false
fake:SetScript("OnUpdate",nil)
fake = nil
return
end
delay = delay + elapsed
if delay > 0.005 then
fake:SetScript("OnUpdate",nil)
fake = nil
_.h = false
if type(event) == "string" then _.__orig_BankFrame_OnEvent(self, event, args)
else _.__orig_HideUIPanel(self) end
end
end)
else
if type(event) == "string" then _.__orig_BankFrame_OnEvent(self, event, args)
else _.__orig_HideUIPanel(self) end
end
end
 
local function SetTradeFrameHook()
local _, a, add = EasyDND, TradeFrame, TradeFrame.SetScript
if _.db.profile.activated then
if _.db.profile.anti_blocktrade and not _.q then
InitiateTrade = __hooked_InitiateTrade
add(a, "OnEvent", __hooked_TradeFrame_OnEvent)
BankFrame_OnEvent = __hooked_Bank_OnEvent
HideUIPanel = __hooked_Bank_OnEvent
_.q = true
elseif _.q and not _.db.profile.anti_blocktrade then
InitiateTrade = _.__orig_InitiateTrade
add(a, "OnEvent", _.__orig_TradeFrame_OnEvent)
BankFrame_OnEvent = _.__orig_BankFrame_OnEvent
HideUIPanel = _.__orig_HideUIPanel
_.q = false
end
end
862,11 → 899,11
end
 
local function InitGlobalVariables()
-- Free: h r t u v w
-- Free: r t u v w
local _ = EasyDND
_.a, _.b, _.c = false, false, false
_.d, _.e, _.f = false, false, false
_.g, _.i = false, false
_.g, _.h, _.i = false, false, false
_.j, _.k, _.l = false, false, false
_.m, _.n, _.o = false, false, false
_.p, _.q = false, false