From 8b4d98cce6995f530099a9bf62487139947087c2 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 9 Apr 2008 08:23:38 +0000 Subject: [PATCH] fix profile issues with the pet bar --- Bartender4.lua | 2 +- PetBar.lua | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Bartender4.lua b/Bartender4.lua index b229239..5e4cb78 100644 --- a/Bartender4.lua +++ b/Bartender4.lua @@ -74,7 +74,7 @@ function Bartender4:Lock() end function Bartender4:Merge(target, source) - if not target then target = {} end + if type(target) ~= "table" then target = {} end for k,v in pairs(source) do if type(v) == "table" then target[k] = self:Merge(target[k], v) diff --git a/PetBar.lua b/PetBar.lua index 9b8bec7..9d2bbb7 100644 --- a/PetBar.lua +++ b/PetBar.lua @@ -12,7 +12,7 @@ local PetBar = setmetatable({}, {__index = ButtonBar}) local PetButtonPrototype = CreateFrame("CheckButton") local PetButton_MT = {__index = PetButtonPrototype} -local defaults = { profile = Bartender4:Merge({ +local defaults = { profile = Bartender4:Merge({ enabled = true, scale = 1.0, }, Bartender4.ButtonBar.defaults) } @@ -331,8 +331,8 @@ function PetBar:OnEvent(event, arg1) end end -function PetBar:ApplyConfig() - ButtonBar.ApplyConfig(self) +function PetBar:ApplyConfig(config) + ButtonBar.ApplyConfig(self, config) self:UpdateButtonLayout() self:ForAll("Update") self:ForAll("ApplyStyle", self.config.style)