From 6b7a118ada0eae8e5d3bbd22a47b86a2f6a9a706 Mon Sep 17 00:00:00 2001 From: Parnic Date: Tue, 2 Dec 2008 06:06:28 +0000 Subject: [PATCH] - fixed a bug that caused the /icehud slash command to not work when the addon was disabled (and therefore be unable to re-enable it). ouch! --- IceCore.lua | 10 +++++++--- IceHUD.lua | 21 +++++++++++---------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/IceCore.lua b/IceCore.lua index ad2282a..d2124f3 100644 --- a/IceCore.lua +++ b/IceCore.lua @@ -92,7 +92,6 @@ function IceCore.prototype:Enable() self:DrawFrame() for i = 1, table.getn(self.elements) do - self.elements[i]:SetDatabase(self.settings) self.elements[i]:Create(self.IceHUDFrame) if (self.elements[i]:IsEnabled()) then self.elements[i]:Enable(true) @@ -104,11 +103,16 @@ end function IceCore.prototype:ProfileChanged() + self:SetModuleDatabases() + + self:Redraw() +end + + +function IceCore.prototype:SetModuleDatabases() for i = 1, table.getn(self.elements) do self.elements[i]:SetDatabase(self.settings) end - - self:Redraw() end diff --git a/IceHUD.lua b/IceHUD.lua index 32cdc59..6d403a3 100644 --- a/IceHUD.lua +++ b/IceHUD.lua @@ -566,6 +566,17 @@ function IceHUD:OnInitialize() self:RegisterDefaults('account', self.IceCore.defaults) end self:RegisterDefaults('profile', self.IceCore.defaults) + + self.IceCore.settings = self.db.profile + self.IceCore:SetModuleDatabases() + self.options.args.modules.args = self.IceCore:GetModuleOptions() + self.options.args.colors.args = self.IceCore:GetColorOptions() + + waterfall:Register("IceHUD", 'aceOptions', IceHUD.options) + + -- Parnic - added /icehudcl to make rock config pick this up + self:RegisterChatCommand({"/icehudcl"}, IceHUD.options) + self:RegisterChatCommand({ "/icehud" }, IceHUD.slashMenu) end @@ -581,21 +592,11 @@ function IceHUD:OnEnable(isFirst) self.db.account.settingsMoved = true end - self.IceCore.settings = self.db.profile self.IceCore:Enable() if isFirst then self:SetDebugging(self.IceCore:GetDebug()) self.debugFrame = ChatFrame2 - - self.options.args.modules.args = self.IceCore:GetModuleOptions() - self.options.args.colors.args = self.IceCore:GetColorOptions() - - waterfall:Register("IceHUD", 'aceOptions', IceHUD.options) - - -- Parnic - added /icehudcl to make rock config pick this up - self:RegisterChatCommand({"/icehudcl"}, IceHUD.options) - self:RegisterChatCommand({ "/icehud" }, IceHUD.slashMenu) end end