WoWInterface SVN EasyDND

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk/EasyDND/frames
    from Rev 54 to Rev 57
    Reverse comparison

Rev 54 → Rev 57

broker.lua
87,30 → 87,82
AdjustDewdropPosition(a)
end
 
local function Anti_AddException()
for i, j in pairs(_.y) do
for k, l in ipairs(_.z) do
if i == l[1] and j == l[2] then -- should not occur but safer
if not _.db.profile.anti_hidenotification then
_:Print(L["Has detected this user already temporarily allowed"].." "..L["to start"]..": "..i)
end
wipe(_.y)
return
end
end
table.insert(_.z, #_.z + 1, { i, j })
if not _.db.profile.anti_hidenotification then
_:Print(L["Temporarily allows"].." \""..j.."\" "..L["to start"]..": "..i)
end
wipe(_.y)
return
end
if not _.db.profile.anti_hidenotification then
_:Print(L["Has not found a blocked action to temporarily allow"])
end
wipe(_.y)
end
 
local function Anti_DelException()
local size = #_.z
if size > 0 then
if not _.db.profile.anti_hidenotification then
_:Print(L["Has removed the exception for the user"].." \"".._.z[#_.z][2].."\" "..L["to start"]..": ".._.z[#_.z][1])
end
table.remove(_.z, #_.z)
return
end
if not _.db.profile.anti_hidenotification then
_:Print(L["Has not found an exception set"])
end
end
 
local function OnLDBClick(self, button)
if button == "LeftButton" then
if IsControlKeyDown() then
if IsAltKeyDown() then
_.db.profile.activated = not _.db.profile.activated
_.ToggleActive()
elseif IsShiftKeyDown() then
Anti_AddException()
else _.ToggleConfig() end
elseif IsShiftKeyDown() then
if UnitIsDND("player") or (_.db.profile.modednd and not UnitIsAFK("player")) then
SendChatMessage("", "DND")
if IsControlKeyDown() then
Anti_AddException()
else
SendChatMessage("", "AFK")
if UnitIsDND("player") or (_.db.profile.modednd and not UnitIsAFK("player")) then
SendChatMessage("", "DND")
else
SendChatMessage("", "AFK")
end
end
else
ToggleDewdrop(self)
end
elseif button == "RightButton" then
ToggleDewdrop(self)
if IsControlKeyDown() then
if IsShiftKeyDown() then
Anti_DelException()
else ToggleDewdrop(self) end
else ToggleDewdrop(self) end
end
end
 
local function UpdateTooltip(g)
local db = _.db.profile
if _.db.profile.showtooltip then
if _.db.profile.ubertooltip then
local owner = GameTooltip:GetOwner()
GameTooltip_SetDefaultAnchor(g, owner)
end
g:ClearLines()
g:AddLine(" ")
getglobal(g:GetName().."TextLeft1"):SetText("EasyDND")
121,46 → 173,52
g:AddLine(" ")
getglobal(g:GetName().."TextLeft3"):SetText(" "..CheckLDBFlag())
g:AddLine(" ")
getglobal(g:GetName().."TextLeft4"):SetText(" "..CheckStatus(db.modeinst)..L[" PvE"])
getglobal(g:GetName().."TextRight4"):SetText(L["IsFriend "]..CheckStatus(db.anti_allowfriends).." ")
getglobal(g:GetName().."TextLeft4"):SetText(" "..CheckStatus(db.modeinst).." "..L["PvE"])
getglobal(g:GetName().."TextRight4"):SetText(L["IsFriend"].." "..CheckStatus(db.anti_allowfriends).." ")
getglobal(g:GetName().."TextRight4"):SetTextColor(0.99999780301005, 0.81960606575012, 0)
getglobal(g:GetName().."TextRight4"):Show()
g:AddLine(" ")
getglobal(g:GetName().."TextLeft5"):SetText(" "..CheckStatus(db.modebg)..L[" PvP"])
getglobal(g:GetName().."TextRight5"):SetText(L["IsGuild "]..CheckStatus(db.anti_allowguild).." ")
getglobal(g:GetName().."TextLeft5"):SetText(" "..CheckStatus(db.modebg).." "..L["PvP"])
getglobal(g:GetName().."TextRight5"):SetText(L["IsGuild"].." "..CheckStatus(db.anti_allowguild).." ")
getglobal(g:GetName().."TextRight5"):SetTextColor(0.99999780301005, 0.81960606575012, 0)
getglobal(g:GetName().."TextRight5"):Show()
g:AddLine(" ")
getglobal(g:GetName().."TextLeft6"):SetText(" "..CheckStatus(db.modeah)..L[" AH"])
getglobal(g:GetName().."TextRight6"):SetText(L["Party "]..CheckStatus(db.anti_blockparty).." ")
getglobal(g:GetName().."TextLeft6"):SetText(" "..CheckStatus(db.modeah).." "..L["AH"])
getglobal(g:GetName().."TextRight6"):SetText(L["Party"].." "..CheckStatus(db.anti_blockparty).." ")
getglobal(g:GetName().."TextRight6"):SetTextColor(0.99999780301005, 0.81960606575012, 0)
getglobal(g:GetName().."TextRight6"):Show()
g:AddLine(" ")
getglobal(g:GetName().."TextLeft7"):SetText(" "..CheckStatus(db.modemail)..L[" Mail"])
getglobal(g:GetName().."TextRight7"):SetText(L["Duel "]..CheckStatus(db.anti_blockduel).." ")
getglobal(g:GetName().."TextLeft7"):SetText(" "..CheckStatus(db.modemail).." "..L["Mail"])
getglobal(g:GetName().."TextRight7"):SetText(L["Duel"].." "..CheckStatus(db.anti_blockduel).." ")
getglobal(g:GetName().."TextRight7"):SetTextColor(0.99999780301005, 0.81960606575012, 0)
getglobal(g:GetName().."TextRight7"):Show()
g:AddLine(" ")
getglobal(g:GetName().."TextLeft8"):SetText(" "..CheckStatus(db.modebank)..L[" Bank"])
getglobal(g:GetName().."TextRight8"):SetText(L["Trade "]..CheckStatus(db.anti_blocktrade).." ")
getglobal(g:GetName().."TextLeft8"):SetText(" "..CheckStatus(db.modebank).." "..L["Bank"])
getglobal(g:GetName().."TextRight8"):SetText(L["Trade"].." "..CheckStatus(db.anti_blocktrade).." ")
getglobal(g:GetName().."TextRight8"):SetTextColor(0.99999780301005, 0.81960606575012, 0)
getglobal(g:GetName().."TextRight8"):Show()
g:AddLine(" ")
getglobal(g:GetName().."TextLeft9"):SetText(" "..CheckStatus(db.modecbt)..L[" Combat"])
getglobal(g:GetName().."TextRight9"):SetText(L["Guild "]..CheckStatus(db.anti_blockguildinvite).." ")
getglobal(g:GetName().."TextLeft9"):SetText(" "..CheckStatus(db.modecbt).." "..L["Combat"])
getglobal(g:GetName().."TextRight9"):SetText(L["Guild"].." "..CheckStatus(db.anti_blockguildinvite).." ")
getglobal(g:GetName().."TextRight9"):SetTextColor(0.99999780301005, 0.81960606575012, 0)
getglobal(g:GetName().."TextRight9"):Show()
g:AddLine(" ")
getglobal(g:GetName().."TextLeft10"):SetText(" "..CheckStatus(db.modednd, true)..L[" ModeDND"])
getglobal(g:GetName().."TextRight10"):SetText(L["Petition "]..CheckStatus(db.anti_blockguildpetition).." ")
getglobal(g:GetName().."TextLeft10"):SetText(" "..CheckStatus(db.modednd, true).." "..L["ModeDND"])
getglobal(g:GetName().."TextRight10"):SetText(L["Petition"].." "..CheckStatus(db.anti_blockguildpetition).." ")
getglobal(g:GetName().."TextRight10"):SetTextColor(0.99999780301005, 0.81960606575012, 0)
getglobal(g:GetName().."TextRight10"):Show()
g:AddLine(" ")
getglobal(g:GetName().."TextLeft11"):SetText(" "..CheckStatus(db.toggleNdnd)..L[" NameDND"])
getglobal(g:GetName().."TextLeft11"):SetText(" "..CheckStatus(db.toggleNdnd).." "..L["NameDND"])
g:AddLine(" ")
getglobal(g:GetName().."TextLeft12"):SetText(" "..CheckStatus(db.toggleNafk)..L[" NameAFK"])
getglobal(g:GetName().."TextLeft12"):SetText(" "..CheckStatus(db.toggleNafk).." "..L["NameAFK"])
if _.db.profile.showhints then
g:AddLine(L["\n|cffeda55fClick|r to open the Dewdrop quick\npanel.\n|cffeda55fCtrl-Click|r to open the AceGUI\nconfiguration window.\n|cffeda55fShift-Click|r to instantly switch your\nstatus to %s mode or remove the\ncurrent mode.\n|cffeda55fCtrl-Alt-Click|r to enable/disable the\naddon."]:format(_.CheckMode()), 0.2, 1, 0.2, 0) -- GameTooltip wrap option is too buggy shame on Blizzard!
g:AddLine(" ")
g:AddLine("|cffeda55f"..L["Click|r to open the Dewdrop quick\npanel."], 0.2, 1, 0.2)
g:AddLine("|cffeda55f"..L["Ctrl-Click|r to open the AceGUI\nconfiguration window."], 0.2, 1, 0.2)
g:AddLine("|cffeda55f"..L["Shift-Click|r to instantly switch your\nstatus to %s mode or remove the\ncurrent mode."]:format(_.CheckMode()), 0.2, 1, 0.2)
g:AddLine("|cffeda55f"..L["Ctrl-Shift-LClick|r add an AntiParasites\nexception. The last blocked user and\nevent will be allowed only one time\nfor the same user and event only."], 0.2, 1, 0.2)
g:AddLine("|cffeda55f"..L["Ctrl-Shift-RClick|r del an AntiParasites\nexception. It removes from the last\nexception added to the first if\nrepeated clicks."], 0.2, 1, 0.2)
g:AddLine("|cffeda55f"..L["Ctrl-Alt-Click|r to enable/disable the\naddon."], 0.2, 1, 0.2, 0) -- GameTooltip wrap option is too buggy shame on Blizzard!
end
end
end
191,7 → 249,7
icon = ICONON,
OnClick = OnLDBClick,
})
 
 
function ldb.OnTooltipShow(g)
if _.db.profile.showtooltip then
UpdateTooltip(g)