WoWInterface SVN EasyDND

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 70 to Rev 71
    Reverse comparison

Rev 70 → Rev 71

EasyDND/EasyDND.toc
19,8 → 19,8
## 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
## Dependencies: Ace3, DewdropLib
## OptionalDeps: LibDBIcon-1.0
## Dependencies: Ace3
## OptionalDeps: LibDBIcon-1.0, DewdropLib
## SavedVariables: EasyDNDDB
## SavedVariablesPerCharacter: EasyDNDDBPC
 
EasyDND/frames/broker.lua
1,5 → 1,5
--[[
Name: EasyDND - AntiParasites / LibDataBroker LibDBIcon-1.0 Dewdrop-2.0
Name: EasyDND - AntiParasites / LibDataBroker LibDBIcon-1.0 DewdropLib
Description: This file handles Broker used for displaying a minimap icon with LibDBIcon-1.0
this add support to all bar mods and/or minimap with minimal spared codes
Thanks Rabbit and Tekkub it saves so much!
21,8 → 21,8
 
if not LibStub then return end
local LDB, LDB_EV = LibStub:GetLibrary("LibDataBroker-1.1"), LibStub("AceEvent-3.0")
local _, L, DEW, ICO = EasyDND, LibStub("AceLocale-3.0"):GetLocale("EasyDND"), LibStub("Dewdrop-2.0"), LibStub("LibDBIcon-1.0", true)
if not ( LDB or _ or L or DEW ) then return end
local _, L, DEW, ICO = EasyDND, LibStub("AceLocale-3.0"):GetLocale("EasyDND"), LibStub("Dewdrop-2.0", true), LibStub("LibDBIcon-1.0", true)
if not ( LDB or _ or L ) then return end
 
local ICONOFF = "Interface\\AddOns\\EasyDND\\icons\\dndoff"
local ICONON = "Interface\\AddOns\\EasyDND\\icons\\dndon"
52,7 → 52,7
 
local function ToggleMinimap()
if _.db.profile.showminimap then
if ICO then ICO:Show("EasyDND") else _:Print("Minimap icon OFF, install LibDBIcon-1.0 or disable the show minimap option.") end
if ICO then ICO:Show("EasyDND") else _:Print("|cff7e7e7e".."Minimap icon disabled, install LibDBIcon-1.0 or disable the show minimap option to hide this warning.".."|r") end
else
if ICO then ICO:Hide("EasyDND") end
end
79,14 → 79,15
end
 
local function ToggleDewdrop(a)
if not DEW then _:Print("|cff7e7e7e".."Quick menu disabled, install DewdropLib to activate this feature.") return end
DEW:Open(a, "children", function()
local a = _.DEW.options.args.messages.args
local b, save = _.DEW.options.args, nil
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
DEW:FeedAceOptionsTable(_.DEW.options)
DEW:FeedAceOptionsTable(DEW.options)
end)
--fix the menu position to not obscurate bar icons
AdjustDewdropPosition(a)
243,6 → 244,27
LDB_EV:RegisterEvent("ZONE_CHANGED_NEW_AREA", UpdateLDB)
end
 
-- 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
local function deepcopy(object)
local lookup_table = {}
local function _copy(object)
if type(object) ~= "table" then
return object
elseif lookup_table[object] then
return lookup_table[object]
end
local new_table = {}
lookup_table[object] = new_table
for index, value in pairs(object) do
new_table[_copy(index)] = _copy(value)
end
return setmetatable(new_table, getmetatable(object))
end
return _copy(object)
end
 
local function InitLDB()
local ldb = LDB:NewDataObject("EasyDND", {
type = "data source",
257,7 → 279,6
end
end
_.LDB = ldb
_.LDB.DEW = DEW
if ICO then _.LDB.ICO = ICO end
_.LDB.ICONON = ICONON
_.LDB.ICONOFF = ICONOFF
269,3 → 290,4
 
_.LDB = {}
_.LDB.InitLDB = InitLDB
if DEW then DEW.options = deepcopy(_.options) end
EasyDND/opts/options.lua
560,27 → 560,3
 
_.options = options
_.defaults = defaults
 
-- 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
local function deepcopy(object)
local lookup_table = {}
local function _copy(object)
if type(object) ~= "table" then
return object
elseif lookup_table[object] then
return lookup_table[object]
end
local new_table = {}
lookup_table[object] = new_table
for index, value in pairs(object) do
new_table[_copy(index)] = _copy(value)
end
return setmetatable(new_table, getmetatable(object))
end
return _copy(object)
end
 
_.DEW = {}
_.DEW.options = deepcopy(options)