From 139f34629b461e6e0f7c7436d7848f0592be05ca Mon Sep 17 00:00:00 2001 From: atomaka Date: Sun, 18 Sep 2011 16:51:56 -0400 Subject: [PATCH] Use LibBabble-Zone to localize instance names. --- .pkgmeta | 1 + ChoreTracker.lua | 33 +++++++++++++++++++++------------ ChoreTracker.toc | 5 +++-- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/.pkgmeta b/.pkgmeta index a885a94..58603aa 100644 --- a/.pkgmeta +++ b/.pkgmeta @@ -7,5 +7,6 @@ externals: Libs/AceConsole-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceConsole-3.0 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 Libs/LibQTip-1.0: svn://svn.wowace.com/wow/libqtip-1-0/mainline/trunk Libs/LibDBIcon-1.0: svn://svn.wowace.com/wow/libdbicon-1-0/mainline/trunk/LibDBIcon-1.0 \ No newline at end of file diff --git a/ChoreTracker.lua b/ChoreTracker.lua index 48863f8..4995b38 100644 --- a/ChoreTracker.lua +++ b/ChoreTracker.lua @@ -1,18 +1,14 @@ ChoreTracker = LibStub('AceAddon-3.0'):NewAddon('ChoreTracker', 'AceConsole-3.0', 'AceEvent-3.0') local core = ChoreTracker -local LibQTip +local LQT local db local LDB local LDBIcon local tooltip +local LBZ +local zones -local trackedInstances = { - ['Baradin Hold'] = 'BH', - ['Firelands'] = 'FL', - ['The Bastion of Twilight'] = 'BoT', - ['Blackwing Descent'] = 'BWD', - ['Throne of the Four Winds'] = '4W', -} +local trackedInstances local defaults = { global = {}, @@ -65,7 +61,9 @@ function core:OnInitialize() end function core:OnEnable() - LibQTip = LibStub('LibQTip-1.0') + LQT = LibStub('LibQTip-1.0') + LBZ = LibStub("LibBabble-Zone-3.0") + LoadAddOn('Blizzard_Calendar') for class,color in pairs(RAID_CLASS_COLORS) do @@ -102,7 +100,7 @@ function core:OnEnable() for instance,abbreviation in pairs(trackedInstances) do columnCount = columnCount + 1 end - tooltip = LibQTip:Acquire('ChoreTrackerTooltip', columnCount, 'LEFT', 'CENTER', 'RIGHT') + tooltip = LQT:Acquire('ChoreTrackerTooltip', columnCount, 'LEFT', 'CENTER', 'RIGHT') core:DrawTooltip() @@ -110,7 +108,7 @@ function core:OnEnable() tooltip:Show() end, OnLeave = function(self) - LibQTip:Release(tooltip) + LQT:Release(tooltip) tooltip = nil end, }) @@ -124,6 +122,17 @@ function core:OnEnable() else self.LDBIcon:Show('ChoreTracker') end + + -- Get instances + zones = LBZ:GetLookupTable() + + trackedInstances = { + [zones['Baradin Hold']] = 'BH', + [zones['Firelands']] = 'FL', + [zones['The Bastion of Twilight']] = 'BoT', + [zones['Blackwing Descent']] = 'BWD', + [zones['Throne of the Four Winds']] = '4W', + } end function core:UpdateChores() @@ -210,7 +219,7 @@ function core:GetNextVPReset() local title,hour,minute = CalendarGetDayEvent(monthOffset, day, i) - if title == 'Baradin Hold' then + if title == zones['Baradin Hold'] then resetDate = { year = year, month = month + monthOffset, day = day } end end diff --git a/ChoreTracker.toc b/ChoreTracker.toc index 64158c0..0c27694 100644 --- a/ChoreTracker.toc +++ b/ChoreTracker.toc @@ -5,7 +5,7 @@ ## Notes: Reminding you to do your chores just like your mother. ## DefaultState: enabled ## SavedVariables: ChoreTrackerDB -## OptionalDeps: LibQTip-1.0, LibDBIcon-1.0 +## OptionalDeps: LibQTip-1.0, LibDBIcon-1.0, LibBabble-Zone-3.0 Libs\LibStub\LibStub.lua Libs\CallbackHandler-1.0\CallbackHandler-1.0.xml @@ -13,8 +13,9 @@ Libs\AceAddon-3.0\AceAddon-3.0.xml Libs\AceConsole-3.0\AceConsole-3.0.xml Libs\AceDB-3.0\AceDB-3.0.xml Libs\AceEvent-3.0\AceEvent-3.0.xml -Libs\LibQTip-1.0\lib.xml +Libs\LibBabble-Zone-3.0\lib.xml Libs\LibDataBroker-1.1\LibDataBroker-1.1.lua Libs\LibDBIcon-1.0\LibDBIcon-1.0.lua +Libs\LibQTip-1.0\lib.xml ChoreTracker.lua \ No newline at end of file