diff --git a/ActionBarPrototype.lua b/ActionBarPrototype.lua index 87bfb83..b522360 100644 --- a/ActionBarPrototype.lua +++ b/ActionBarPrototype.lua @@ -171,6 +171,11 @@ function ActionBar:UpdateButtons(numbuttons) end end +function ActionBar:SkinChanged(...) + ButtonBar.SkinChanged(self, ...) + self:ForAll("Update") +end + --[[=================================================================================== ActionBar Config Interface diff --git a/ActionBars.lua b/ActionBars.lua index 14e1192..a6de689 100644 --- a/ActionBars.lua +++ b/ActionBars.lua @@ -80,10 +80,6 @@ function BT4ActionBars:OnEnable() end end - if LBF then - LBF:RegisterSkinCallback("Bartender4", self.UpdateSkin, self) - end - first = nil end @@ -139,13 +135,6 @@ function BT4ActionBars:ApplyConfig() end end -function BT4ActionBars:UpdateSkin(SkinID, Gloss, Backdrop, Group, Button) - local id = tonumber(Group) - if id and self.actionbars[id] then - self.actionbars[id]:ForAll("Update") - end -end - -- we do not allow to disable the actionbars module function BT4ActionBars:ToggleModule() return diff --git a/Button.lua b/Button.lua index 4ed9ab3..1c6725b 100644 --- a/Button.lua +++ b/Button.lua @@ -46,6 +46,7 @@ function Bartender4.Button:Create(id, parent) button.Proxy:SetPushedTexture("") button.Proxy:SetHighlightTexture("") button.Proxy:SetCheckedTexture("") + button.Proxy:Show() local NormalTexture = button.Proxy:GetNormalTexture() NormalTexture:SetWidth(66) @@ -411,6 +412,7 @@ function Button:SetTooltip() end function Button:ShowButton() + if self.Proxy:IsShown() then return end self.pushedTexture:SetTexture(self.textureCache.pushed) self.highlightTexture:SetTexture(self.textureCache.highlight) diff --git a/ButtonBar.lua b/ButtonBar.lua index 1e6cfc2..7790720 100644 --- a/ButtonBar.lua +++ b/ButtonBar.lua @@ -9,6 +9,11 @@ local ButtonBar_MT = {__index = ButtonBar} local defaults = Bartender4:Merge({ padding = 2, rows = 1, + skin = { + ID = "DreamLayout", + Backdrop = true, + Gloss = false, + }, }, Bartender4.Bar.defaults) Bartender4.ButtonBar = {} @@ -22,11 +27,24 @@ function Bartender4.ButtonBar:Create(id, template, config) if LBF then bar.LBFGroup = LBF:Group("Bartender4", tostring(id)) + bar.LBFGroup.SkinID = config.skin.ID or "Blizzard" + bar.LBFGroup.Backdrop = config.skin.Backdrop + bar.LBFGroup.Gloss = config.skin.Gloss + + LBF:RegisterSkinCallback("Bartender4", self.SkinChanged, self) end return bar end +local barregistry = Bartender4.Bar.barregistry +function Bartender4.ButtonBar:SkinChanged(SkinID, Gloss, Backdrop, Group, Button) + local bar = barregistry[tostring(Group)] + if not bar then return end + + bar:SkinChanged(SkinID, Gloss, Backdrop, Button) +end + --[[=================================================================================== Bar Options ===================================================================================]]-- @@ -166,6 +184,12 @@ function ButtonBar:UpdateButtonLayout() end end +function ButtonBar:SkinChanged(SkinID, Gloss, Backdrop, Button) + self.config.skin.ID = SkinID + self.config.skin.Gloss = Gloss + self.config.skin.Backdrop = Backdrop +end + --[[=================================================================================== Utility function ===================================================================================]]--