From 41d6b3beaa7662786fad169cc07b7f79aac51812 Mon Sep 17 00:00:00 2001 From: atomaka Date: Fri, 16 Sep 2011 16:00:16 -0400 Subject: [PATCH] Actually load LibQTib and create options interface. --- ChoreTracker.lua | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/ChoreTracker.lua b/ChoreTracker.lua index faa401f..896ffde 100644 --- a/ChoreTracker.lua +++ b/ChoreTracker.lua @@ -1,6 +1,7 @@ ChoreTracker = LibStub('AceAddon-3.0'):NewAddon('ChoreTracker', 'AceConsole-3.0', 'AceEvent-3.0') local core = ChoreTracker local LibQTip +local db local trackedInstances = { ['Baradin Hold'] = 'BH', @@ -11,7 +12,27 @@ local trackedInstances = { } local defaults = { - global = {} + global = {}, + profile = { + instances = {}, + }, +} + +local options_setter = function(info, v) local t=core.db.profile for k=1,#info-1 do t=t[info[k]] end t[info[#info]]=v end +local options_getter = function(info) local t=core.db.profile for k=1,#info-1 do t=t[info[k]] end return t[info[#info]] end +local options = { + name = 'ChoreTracker', + type = 'group', + set = options_setter, + get = options_getter, + args = { + enabled = { + name = 'Toggle Instances', + type = 'group', + order = 10, + args = {}, + } + } } local classColors = {} @@ -44,6 +65,13 @@ function core:OnInitialize() } self.db.global[realm][name].lockouts = {} end + + -- Generate our options and add them to Blizzard Interface + LibStub('AceConfigRegistry-3.0'):RegisterOptionsTable('ChoreTracker', options) + local ACD = LibStub('AceConfigDialog-3.0') + ACD:AddToBlizOptions('ChoreTracker', 'ChoreTracker') + + LoadAddOn('LibQTip-1.0') end function core:OnEnable()