add support for cyCircled button skinning
This commit is contained in:
@@ -23,6 +23,12 @@ function Bartender4:OnInitialize()
|
||||
MainMenuBar:Hide()
|
||||
end
|
||||
|
||||
function Bartender4:OnEnable()
|
||||
if IsAddOnLoaded("cyCircled") then
|
||||
self:SecureHook(cyCircled, "LoadPlugins", "cyLoaded")
|
||||
end
|
||||
end
|
||||
|
||||
function Bartender4:RegisterDefaultsKey(key, subdefaults)
|
||||
defaults.profile[key] = subdefaults
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
## Title: Bartender4
|
||||
## Author: Nevcairiel
|
||||
## SavedVariables: Bartender4DB
|
||||
## OptionalDeps: Ace3
|
||||
## OptionalDeps: Ace3, cyCircled
|
||||
## X-Embeds: Ace3
|
||||
## X-Category: Action Bars
|
||||
## Version: 4.0
|
||||
|
||||
+27
-5
@@ -35,20 +35,37 @@ local styledata = {
|
||||
},
|
||||
}
|
||||
|
||||
function Bartender4.ButtonStyle.ApplyStyle(button, style)
|
||||
if not button.icon then return end
|
||||
local style = styledata[style]
|
||||
local cydb
|
||||
|
||||
if style.overlay and style.FrameFunc and (not button.overlay or button.overlay.type ~= style) then
|
||||
function Bartender4.ButtonStyle.ApplyStyle(button, styleName)
|
||||
if not button.icon then return end
|
||||
local style = styledata[styleName]
|
||||
|
||||
local cy = cydb and cydb.profile[button:GetParent().id]
|
||||
--DevTools_Dump(cydb and cydb.profile)
|
||||
|
||||
if cy then
|
||||
style = styledata.default
|
||||
if button.overlay and button.overlay.type ~= "cy" then
|
||||
button.overlay:Hide()
|
||||
button.overlay = _G[button:GetName() .. "Overlay"]
|
||||
button.overlay.type = "cy"
|
||||
end
|
||||
end
|
||||
|
||||
if style.overlay and style.FrameFunc then
|
||||
if not button.overlay or button.overlay.type ~= styleName then
|
||||
if button.overlay then button.overlay:Hide() end
|
||||
button.overlay = style.FrameFunc(button)
|
||||
end
|
||||
else
|
||||
if button.overlay then
|
||||
if button.overlay and button.overlay.type ~= "cy" then
|
||||
button.overlay:Hide()
|
||||
button.overlay = nil
|
||||
end
|
||||
end
|
||||
|
||||
if cy then return end
|
||||
|
||||
if style.texCoord then
|
||||
button.icon:SetTexCoord(unpack(style.texCoord))
|
||||
@@ -68,3 +85,8 @@ end
|
||||
function Bartender4.ButtonStyle:GetStyles()
|
||||
return styles
|
||||
end
|
||||
|
||||
function Bartender4:cyLoaded()
|
||||
cydb = cyCircled_Bartender4 and cyCircled_Bartender4.db
|
||||
Bartender4.Bar:ForAll("ApplyConfig")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user