From 2639a27e4bbb52240a77e600c47dcc42c6c92a34 Mon Sep 17 00:00:00 2001 From: atomaka Date: Sun, 18 Sep 2011 18:12:03 -0400 Subject: [PATCH] Messing around with some options stuff. --- .pkgmeta | 1 + ChoreTracker.lua | 31 ++++++++++++++++++++++++++++--- ChoreTracker.toc | 1 + 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.pkgmeta b/.pkgmeta index 58603aa..1d42bc4 100644 --- a/.pkgmeta +++ b/.pkgmeta @@ -5,6 +5,7 @@ externals: Libs/AceAddon-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceAddon-3.0 Libs/CallbackHandler-1.0: svn://svn.wowace.com/wow/callbackhandler/mainline/trunk/CallbackHandler-1.0 Libs/AceConsole-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceConsole-3.0 + Libs/AceConfig-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk Libs/AceDB-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceDB-3.0 Libs/AceEvent-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceEvent-3.0 Libs/LibBabble-Zone-3.0: svn://svn.wowace.com/wow/libbabble-zone-3-0/mainline/trunk diff --git a/ChoreTracker.lua b/ChoreTracker.lua index 4995b38..b45c0fb 100644 --- a/ChoreTracker.lua +++ b/ChoreTracker.lua @@ -7,7 +7,6 @@ local LDBIcon local tooltip local LBZ local zones - local trackedInstances local defaults = { @@ -20,6 +19,27 @@ local defaults = { }, } +local options = { + name = 'ChoreTracker', + type = 'group', + args = { + minimap = { + name = 'Hide Minimap Icon', + desc = 'Removes the icon from your minimap.', + type = 'toggle', + get = function(info) return core.db.profile.minimap.hide end, + set = function(info, value) + core.db.profile.minimap.hide = value + if core.db.profile.minimap.hide then + core.LDBIcon:Hide('ChoreTracker') + else + core.LDBIcon:Show('ChoreTracker') + end + end, + } + } +} + local classColors = {} local flagColors = {} @@ -62,7 +82,7 @@ end function core:OnEnable() LQT = LibStub('LibQTip-1.0') - LBZ = LibStub("LibBabble-Zone-3.0") + LBZ = LibStub('LibBabble-Zone-3.0') LoadAddOn('Blizzard_Calendar') @@ -94,7 +114,7 @@ function core:OnEnable() type = 'data source', text = 'ChoreTracker', icon = 'Interface\\AddOns\\ChoreTracker\\icon', - OnClick = function() print('ChoreTracker test') end, + OnClick = function() LibStub("AceConfigDialog-3.0"):Open("ChoreTracker") end, OnEnter = function(self) local columnCount = 2 for instance,abbreviation in pairs(trackedInstances) do @@ -133,6 +153,11 @@ function core:OnEnable() [zones['Blackwing Descent']] = 'BWD', [zones['Throne of the Four Winds']] = '4W', } + + -- Add options to Interface Panel + LibStub('AceConfigRegistry-3.0'):RegisterOptionsTable('ChoreTracker', options) + local ACD = LibStub('AceConfigDialog-3.0') + ACD:AddToBlizOptions('ChoreTracker', 'ChoreTracker') end function core:UpdateChores() diff --git a/ChoreTracker.toc b/ChoreTracker.toc index 0c27694..193ee82 100644 --- a/ChoreTracker.toc +++ b/ChoreTracker.toc @@ -11,6 +11,7 @@ Libs\LibStub\LibStub.lua Libs\CallbackHandler-1.0\CallbackHandler-1.0.xml Libs\AceAddon-3.0\AceAddon-3.0.xml Libs\AceConsole-3.0\AceConsole-3.0.xml +Libs\AceConfig-3.0\AceConfig-3.0.xml Libs\AceDB-3.0\AceDB-3.0.xml Libs\AceEvent-3.0\AceEvent-3.0.xml Libs\LibBabble-Zone-3.0\lib.xml