/trunk
local function ToggleDewdrop(a) |
DEW:Open(a, "children", function() |
local a = _.DEW.options.args.messages.args |
local b, save = _.DEW.options.args, nil |
a.msgcbt.type, a.msgmail.type, a.msgbank.type, a.msgah.type, a.msginst.type, a.msgbg.type = "text", "text", "text", "text", "text", "text" |
a.message_blockparty.type, a.message_blockduel.type, a.message_blocktrade.type = "text", "text", "text" |
a.message_blockguildinvite.type, a.message_blockguildpetition.type = "text", "text" |
b.aceConfig.order = 35 b.blizzConfig.order = 40 b.activated.order = 45 |
_.ToggleAce3ToAce2Types("dew") |
DEW:FeedAceOptionsTable(_.DEW.options) |
end) |
--fix the menu position to not obscurate bar icons |
local defaults = { |
profile = { |
sig = "[EasyDND] ", |
messagebg = L["Sorry I am currently busy in a battleground or arena. Please try again later."], |
messageinst = L["Sorry I am currently busy in an instance. Please try again later."], |
messageah = L["Sorry I am currently busy browsing the auction house. Please try again later."], |
-- this function is used to clone the default table for Dewdrop-2.0 to apply changes on it without breaking the Ace3 table. |
-- http://lua-users.org/wiki/CopyTable |
-- Changes to the table are committed in the ToggleDewdrop function |
-- Changes to the table are committed in the ToggleAce3ToAce2Types() function |
local function deepcopy(object) |
local lookup_table = {} |
local function _copy(object) |
db.anti_counter = db.anti_counter + 1 |
end |
local sig = "[EasyDND] " -- == Don't modify |
local sig2 = "[AntiParasites] " -- == Don't modify |
local function __hooked_PetitionFrame_OnEvent(self, event, ...) |
local _ = EasyDND |
if event == "PETITION_SHOW" and _.db.profile.anti_blockguildpetition then |
SetVar(L["Petition"], name) |
_.LDB.UpdateLDB() |
if not _.db.profile.anti_hidenotification then _:Print(L["Has blocked a guild petition from"].." \""..name.."\" "..L["for"].." <"..guild..">") end |
SendChatMessage(sig2.._.db.profile.message_blockguildpetition, "WHISPER", nil, name) |
SendChatMessage(_.db.profile.sig.._.db.profile.message_blockguildpetition, "WHISPER", nil, name) |
ClosePetition() |
else |
_.__orig_PetitionFrame_OnEvent(self, event, ...) |
SetVar(L["Trade"], name) |
_.LDB.UpdateLDB() |
if not _.db.profile.anti_hidenotification then _:Print(L["Has blocked a trade invitation from"].." \""..name.."\"") end |
SendChatMessage(sig2.._.db.profile.message_blocktrade, "WHISPER", nil, name) |
SendChatMessage(_.db.profile.sig.._.db.profile.message_blocktrade, "WHISPER", nil, name) |
CancelTrade() |
else _.b = false _.__orig_TradeFrame_OnEvent(self, event, ...) end |
else _.b = false _.__orig_TradeFrame_OnEvent(self, event, ...) end |
SetVar(L["Party"], name) |
_.LDB.UpdateLDB() |
if not _.db.profile.anti_hidenotification then _:Print(L["Has blocked a group invitation from"].." \""..name.."\"") end |
SendChatMessage(sig2.._.db.profile.message_blockparty, "WHISPER", nil, name) |
SendChatMessage(_.db.profile.sig.._.db.profile.message_blockparty, "WHISPER", nil, name) |
HideUIPanel(StaticPopup1) |
DeclineGroup() |
end |
SetVar(L["Guild"], name) |
_.LDB.UpdateLDB() |
if not _.db.profile.anti_hidenotification then _:Print(L["Has blocked a guild invitation from"].." \""..name.."\" "..L["for"].." <"..guild..">") end |
SendChatMessage(sig2.._.db.profile.message_blockguildinvite, "WHISPER", nil, name) |
SendChatMessage(_.db.profile.sig.._.db.profile.message_blockguildinvite, "WHISPER", nil, name) |
HideUIPanel(StaticPopup1) |
DeclineGuild() |
-- removes the workaround |
SetVar(L["Duel"], name) |
_.LDB.UpdateLDB() |
if not _.db.profile.anti_hidenotification then _:Print(L["Has blocked a duel invitation from"].." \""..name.."\"") end |
SendChatMessage(sig2.._.db.profile.message_blockduel, "WHISPER", nil, name) |
SendChatMessage(_.db.profile.sig.._.db.profile.message_blockduel, "WHISPER", nil, name) |
HideUIPanel(StaticPopup1) |
CancelDuel() |
end |
local function OnWhispAntiFilter(b) |
local _ = EasyDND |
if _.db.profile.anti_hidereply then |
if string.find(b, "[AntiParasites] ", 1, true) then |
if string.find(b, "[EasyDND] ", 1, true) then |
return true |
end |
end |
local db = _.db.profile |
if msg then |
if db.modednd or IsIn() == "BG" then |
if not UnitIsDND("player") then send(sig..msg, "DND") end |
if not UnitIsDND("player") then send(db.sig..msg, "DND") end |
elseif IsIn() ~= "BG" then |
if not UnitIsAFK("player") then send(sig..msg, "AFK") end |
if not UnitIsAFK("player") then send(db.sig..msg, "AFK") end |
end |
elseif broker then |
-- Here aswell this is very important to never use /AFK in BG/Arenas sorry for omitting this for a long time heh ;p |
end |
end |
local function ToggleAce3ToAce2Types(type) |
local _ = EasyDND |
if type == "dew" then |
local a = _.DEW.options.args.messages.args |
local b, save = _.DEW.options.args, nil |
a.msgcbt.type, a.msgmail.type, a.msgbank.type, a.msgah.type, a.msginst.type, a.msgbg.type = "text", "text", "text", "text", "text", "text" |
a.message_blockparty.type, a.message_blockduel.type, a.message_blocktrade.type = "text", "text", "text" |
a.message_blockguildinvite.type, a.message_blockguildpetition.type = "text", "text" |
b.aceConfig.order = 35 b.blizzConfig.order = 40 b.activated.order = 45 |
end |
end |
local function ToggleConfig() |
if not ACD.OpenFrames["EasyDND"] then |
ACD:SetDefaultSize("EasyDND", 460, 500) |
_.SetGuildPetitionHook = SetGuildPetitionHook |
_.SetTradeFrameHook = SetTradeFrameHook |
_.ToggleConfig = ToggleConfig |
_.ToggleAce3ToAce2Types = ToggleAce3ToAce2Types |
_.CheckMode = CheckMode |
_.ToggleActive = ToggleActive |
_.SetAutoToggleNames = SetAutoToggleNames |
## Interface: 30000 |
## Title: EasyDND |cff7fff7f -Ace3-|r |
## Version: 3.0.8.$Revision$ |
## X-Revision: $Revision$ |
## X-Date: $Date$ |
## Author: Merah |
## Notes: Automatically deny guild, trade, duel, party invitations, guild petitions, remove sounds and forced AH, mail windows closure, automatically activate DND or AFK modes in various situations, etc.. |
## Notes-ruRU: ÐвÑомаÑиÑеÑки оÑменÑÐµÑ Ð¿ÑиглаÑÐµÐ½Ð¸Ñ Ð² гилÑдии, обмен, дÑÑли, пÑиглаÑÐµÐ½Ð¸Ñ Ð² гÑÑппÑ, пеÑиÑии гилÑдии, ÑбеÑÐ°ÐµÑ Ð·Ð²Ñки и ÑÑкоÑÑÐµÑ ÐУÐ, ÑпÑоÑение окна поÑÑÑ, авÑомаÑиÑеÑки акÑивиÑÑÐµÑ Ñежи ÐÑÑÑÑÑÑÐ²Ð¸Ñ Ð¸Ð»Ð¸ ÐанÑÑноÑÑи в ÑазлиÑнÑÑ ÑиÑÑаÑиÑÑ Ð¸ Ñ.д.. |
## Notes-koKR: 길ë, ê±°ë, ê²°í¬, íí° ì´ë, 길ë ìëª ìì²ì ìëì¼ë¡ ê±°ë¶í ì ìì¼ë©°, ì°í¸í¨, 경매ì¥, ìíë±ì ì´ì©í ë, ìëì¼ë¡ ì리ë¹ì í¹ì ë¤ë¥¸ ì©ë¬´ì¤ì¼ë¡ 모ë를 ë³ê²½í ì ììµëë¤. |
## X-EMail: ad@heapoverflow.com |
## X-Website: http://www.wowinterface.com/downloads/info8717-EasyDND.html |
## X-eMail: ad@heapoverflow.com |
## X-Website1: http://www.wowinterface.com/downloads/info8717-EasyDND.html |
## X-Website2: http://wow.curse.com/downloads/wow-addons/details/easydnd.aspx |
## X-SVN: svn://svn.wowinterface.com/EasyDND-211 |
## X-AceForum: 12882 |
## X-RelSite-UI.WoW: 6355 |
## X-Category: Miscellaneous |
## X-Localizations: enUS, frFR, deDE, ruRU, koKR |
## X-CompatibleLocales: enUS, enGB, esES, esMX, deDE, frFR, ruRU, koKR, zhCN, zhTW, enCN, enTW |
## X-Embeds: LibDataBroker-1.1, Dewdrop-2.0 |
## Dependencies: Ace3, LibDBIcon-1.0 |
## X-Embeds: Ace3, Dewdrop-2.0, LibDataBroker-1.1 |
## SavedVariables: EasyDNDDB |
## SavedVariablesPerCharacter: EasyDNDDBPC |
## OptionalDeps: Broker2FuBar, FuBar, Titan |
embeds.xml |