From 8060002efc4e7eb7d7b0ca159e629ba2bff741d1 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 20 Jun 2008 00:03:21 +0000 Subject: [PATCH] commit the other half of that <.< --- ActionBars.lua | 2 +- BagBar.lua | 4 ++-- Bar.lua | 5 +++-- ButtonBar.lua | 4 ++-- MicroMenu.lua | 4 ++-- Options.lua | 3 ++- PetBar.lua | 4 ++-- StanceBar.lua | 4 ++-- 8 files changed, 16 insertions(+), 14 deletions(-) diff --git a/ActionBars.lua b/ActionBars.lua index 0c5ffd8..f56b371 100644 --- a/ActionBars.lua +++ b/ActionBars.lua @@ -207,7 +207,7 @@ end -- Creates a new bar object based on the id and the specified config function BT4ActionBars:Create(id, config) local id = tostring(id) - local bar = setmetatable(Bartender4.ButtonBar:Create(id, config), ActionBar_MT) + local bar = setmetatable(Bartender4.ButtonBar:Create(id, config, (L["Bar %s"]):format(id)), ActionBar_MT) bar.module = self self:CreateBarOption(id) diff --git a/BagBar.lua b/BagBar.lua index b9ec76b..d192b83 100644 --- a/BagBar.lua +++ b/BagBar.lua @@ -27,7 +27,7 @@ local noopFunc = function() end function BagBarMod:OnEnable() if not self.bar then - self.bar = setmetatable(Bartender4.ButtonBar:Create(L["Bag"], self.db.profile), {__index = BagBar}) + self.bar = setmetatable(Bartender4.ButtonBar:Create("BagBar", self.db.profile, L["Bag Bar"]), {__index = BagBar}) -- TODO: real start position self.bar:SetPoint("CENTER") @@ -102,7 +102,7 @@ function BagBarMod:SetupOptions() desc = L["Configure the Bag Bar"], childGroups = "tab", } - Bartender4:RegisterBarOptions(L["Bag"], self.options) + Bartender4:RegisterBarOptions("BagBar", self.options) end self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions end diff --git a/Bar.lua b/Bar.lua index 775bce2..154beb1 100644 --- a/Bar.lua +++ b/Bar.lua @@ -64,13 +64,14 @@ Bartender4.Bar = {} Bartender4.Bar.defaults = defaults Bartender4.Bar.prototype = Bar Bartender4.Bar.barregistry = barregistry -function Bartender4.Bar:Create(id, config) +function Bartender4.Bar:Create(id, config, name) id = tostring(id) assert(not barregistry[id], "duplicated entry in barregistry.") local bar = setmetatable(CreateFrame("Frame", ("BT4Bar%s"):format(id), UIParent, "SecureStateHeaderTemplate"), Bar_MT) barregistry[id] = bar bar.id = id + bar.name = name or id bar:SetMovable(true) local overlay = CreateFrame("Button", bar:GetName() .. "Overlay", bar) @@ -90,7 +91,7 @@ function Bartender4.Bar:Create(id, config) overlay:SetBackdropBorderColor(0.5, 0.5, 0, 0) overlay.Text = overlay:CreateFontString(nil, "ARTWORK") overlay.Text:SetFontObject(GameFontNormal) - overlay.Text:SetText((tonumber(id) and L["Bar %s"] or L["%s Bar"]):format(id)) + overlay.Text:SetText(name) overlay.Text:Show() overlay.Text:ClearAllPoints() overlay.Text:SetPoint("CENTER", overlay, "CENTER") diff --git a/ButtonBar.lua b/ButtonBar.lua index 3248dbd..a6eb0af 100644 --- a/ButtonBar.lua +++ b/ButtonBar.lua @@ -24,8 +24,8 @@ Bartender4.ButtonBar.defaults = defaults local LBF = LibStub("LibButtonFacade", true) -function Bartender4.ButtonBar:Create(id, config) - local bar = setmetatable(Bartender4.Bar:Create(id, config), ButtonBar_MT) +function Bartender4.ButtonBar:Create(id, config, name) + local bar = setmetatable(Bartender4.Bar:Create(id, config, name), ButtonBar_MT) if LBF then bar.LBFGroup = LBF:Group("Bartender4", tostring(id)) diff --git a/MicroMenu.lua b/MicroMenu.lua index 1e0992a..7d88350 100644 --- a/MicroMenu.lua +++ b/MicroMenu.lua @@ -26,7 +26,7 @@ local noopFunc = function() end function MicroMenuMod:OnEnable() if not self.bar then - self.bar = setmetatable(Bartender4.Bar:Create(L["MicroMenu"], self.db.profile), {__index = MicroMenuBar}) + self.bar = setmetatable(Bartender4.Bar:Create("MicroMenu", self.db.profile, L["Micro Menu"]), {__index = MicroMenuBar}) local buttons = {} table_insert(buttons, CharacterMicroButton) table_insert(buttons, SpellbookMicroButton) @@ -98,7 +98,7 @@ function MicroMenuMod:SetupOptions() desc = L["Configure the Micro Menu"], childGroups = "tab", } - Bartender4:RegisterBarOptions(L["MicroMenu"], self.options) + Bartender4:RegisterBarOptions("MicroMenu", self.options) end self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions end diff --git a/Options.lua b/Options.lua index 2182028..118ab01 100644 --- a/Options.lua +++ b/Options.lua @@ -1,6 +1,7 @@ --[[ $Id$ ]] local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4") +local FAQ = LibStub("AceLocale-3.0"):GetLocale("Bartender4_FAQ") local AceConfigDialog = LibStub("AceConfigDialog-3.0") @@ -131,7 +132,7 @@ local function getOptions() args = { faq = { type = "description", - name = L["FAQ_TEXT"], + name = FAQ["FAQ_TEXT"], }, }, }, diff --git a/PetBar.lua b/PetBar.lua index 914ac5b..7659d32 100644 --- a/PetBar.lua +++ b/PetBar.lua @@ -27,7 +27,7 @@ end function PetBarMod:OnEnable() if not self.bar then - self.bar = setmetatable(Bartender4.ButtonBar:Create(L["Pet"], self.db.profile), {__index = PetBar}) + self.bar = setmetatable(Bartender4.ButtonBar:Create("PetBar", self.db.profile, L["Pet Bar"]), {__index = PetBar}) local buttons = {} for i=1,10 do @@ -162,7 +162,7 @@ function PetBarMod:SetupOptions() desc = L["Configure the Pet Bar"], childGroups = "tab", } - Bartender4:RegisterBarOptions(L["Pet"], self.options) + Bartender4:RegisterBarOptions("PetBar", self.options) end self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions end diff --git a/StanceBar.lua b/StanceBar.lua index 258b23d..b767fc1 100644 --- a/StanceBar.lua +++ b/StanceBar.lua @@ -29,7 +29,7 @@ end function StanceBarMod:OnEnable() if not self.bar then - self.bar = setmetatable(Bartender4.ButtonBar:Create(L["Stance"], self.db.profile), {__index = StanceBar}) + self.bar = setmetatable(Bartender4.ButtonBar:Create("StanceBar", self.db.profile, L["Stance Bar"]), {__index = StanceBar}) self.bar:ClearSetPoint("CENTER") self.bar:SetScript("OnEvent", StanceBar.OnEvent) @@ -93,7 +93,7 @@ function StanceBarMod:SetupOptions() childGroups = "tab", disabled = function(info) return GetNumShapeshiftForms() == 0 end, } - Bartender4:RegisterBarOptions(L["Stance"], self.options) + Bartender4:RegisterBarOptions("StanceBar", self.options) end self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions end