/trunk
<Include file="Libs\CallbackHandler-1.0\CallbackHandler-1.0.xml"/> |
<Include file="Libs\LibDataBroker-1.1\LibDataBroker-1.1.lua"/> |
<Include file="Libs\LibQTip-1.0\LibQTip-1.0.lua"/> |
<Include file="Libs\LibDBIcon-1.0\LibDBIcon-1.0.lua"/> |
<Include file="Libs\AceAddon-3.0\AceAddon-3.0.xml"/> |
<Include file="Libs\AceBucket-3.0\AceBucket-3.0.xml"/> |
<Include file="Libs\AceGUI-3.0\AceGUI-3.0.xml"/> |
local LDB = LibStub("LibDataBroker-1.1") |
local LibQTip = LibStub:GetLibrary("LibQTip-1.0") |
local LDBIcon = LibStub("LibDBIcon-1.0") |
--- Some local helper functions |
local tinsert = table.insert |
OnLeave = do_OnLeave, |
OnClick = do_OnClick, |
}) |
LDBIcon:Register("GuildTrackerIcon", self.dbo, self.db.profile.options.minimap) |
LibStub("AceConfig-3.0"):RegisterOptionsTable("GuildTracker", self.options) |
options = { |
autoreset = false, |
autorefresh = true, |
expiredays = 3, |
inactive = 30, |
timeformat = 2, |
minimap = { |
hide = true, |
}, |
alerts = { |
sound = true, |
chatmessage = true, |
descStyle = "inline", |
type = "toggle", |
width = "full", |
order = 3, |
order = 2, |
get = function(key) return self.db.profile.options.autorefresh end, |
set = function(key, value) |
self.db.profile.options.autorefresh = value |
descStyle = "inline", |
type = "toggle", |
width = "full", |
order = 4, |
order = 3, |
get = function(key) return self.db.profile.options.tooltip.grouping end, |
set = function(key, value) self.db.profile.options.tooltip.grouping = value end, |
}, |
minimap = { |
name = CLR_YELLOW .. "Minimap icon", |
desc = "Display a separate minimap icon", |
descStyle = "inline", |
type = "toggle", |
width = "full", |
order = 5, |
get = function(key) return not self.db.profile.options.minimap.hide end, |
set = function(key, value) |
self.db.profile.options.minimap.hide = not value |
self:UpdateMinimapIcon() |
end, |
}, |
}, |
timeformat = { |
name = CLR_YELLOW .. "Timestamp format", |
desc = function() |
CLR_YELLOW..TimeFormat[4].."|r\n"..ICON_TIMESTAMP .. CLR_GRAY .. " or|r " .. f14 .. "\n".. ICON_TIMESTAMP .. CLR_GRAY .. " or|r " .. f24 |
end, |
type = "select", |
order = 6, |
order = 4, |
values = function() return self:GetTableValues(TimeFormat) end, |
get = function(key) return self.db.profile.options.timeformat end, |
set = function(key, value) self.db.profile.options.timeformat = value end, |
return self.db.profile.output.chat[name] |
end |
function GuildTracker:UpdateMinimapIcon() |
if self.db.profile.options.minimap.hide then |
LDBIcon:Hide("GuildTrackerIcon") |
else |
LDBIcon:Show("GuildTrackerIcon") |
end |
end |
function GuildTracker:EnableCustomChannel(name, value) |
if value and not self.db.profile.output.channel[name] then |