- remove cyCircled support
- add preliminary ButtonFacade support (still some bugs in it) - this also replaces the built-in skin selection for the bars (for now)
This commit is contained in:
@@ -153,7 +153,6 @@ function ActionBar:UpdateButtons(numbuttons)
|
|||||||
-- show active buttons
|
-- show active buttons
|
||||||
for i = 1, numbuttons do
|
for i = 1, numbuttons do
|
||||||
buttons[i]:Show()
|
buttons[i]:Show()
|
||||||
buttons[i]:ApplyStyle(self.config.style)
|
|
||||||
buttons[i]:UpdateAction(true)
|
buttons[i]:UpdateAction(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -61,6 +61,9 @@ function BT4ActionBars:OnInitialize()
|
|||||||
ActionBar_MT = {__index = ActionBar}
|
ActionBar_MT = {__index = ActionBar}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local LBF = LibStub("LibButtonFacade", true)
|
||||||
|
|
||||||
-- setup the 10 actionbars
|
-- setup the 10 actionbars
|
||||||
local first = true
|
local first = true
|
||||||
function BT4ActionBars:OnEnable()
|
function BT4ActionBars:OnEnable()
|
||||||
@@ -77,6 +80,10 @@ function BT4ActionBars:OnEnable()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if LBF then
|
||||||
|
LBF:RegisterSkinCallback("Bartender4", self.UpdateSkin, self)
|
||||||
|
end
|
||||||
|
|
||||||
first = nil
|
first = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -132,6 +139,13 @@ function BT4ActionBars:ApplyConfig()
|
|||||||
end
|
end
|
||||||
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
|
-- we do not allow to disable the actionbars module
|
||||||
function BT4ActionBars:ToggleModule()
|
function BT4ActionBars:ToggleModule()
|
||||||
return
|
return
|
||||||
|
|||||||
+3
-4
@@ -25,11 +25,10 @@ function Bartender4:OnInitialize()
|
|||||||
MainMenuBar:Hide()
|
MainMenuBar:Hide()
|
||||||
end
|
end
|
||||||
|
|
||||||
function Bartender4:OnEnable()
|
--[[ function Bartender4:OnEnable()
|
||||||
if IsAddOnLoaded("cyCircled") then
|
--
|
||||||
self:SecureHook(cyCircled, "LoadPlugins", "cyLoaded")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
--]]
|
||||||
|
|
||||||
function Bartender4:RegisterDefaultsKey(key, subdefaults)
|
function Bartender4:RegisterDefaultsKey(key, subdefaults)
|
||||||
defaults.profile[key] = subdefaults
|
defaults.profile[key] = subdefaults
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
## Title: Bartender4
|
## Title: Bartender4
|
||||||
## Author: Nevcairiel
|
## Author: Nevcairiel
|
||||||
## SavedVariables: Bartender4DB
|
## SavedVariables: Bartender4DB
|
||||||
## OptionalDeps: Ace3
|
## OptionalDeps: Ace3, ButtonFacade
|
||||||
## X-Embeds: Ace3
|
## X-Embeds: Ace3
|
||||||
## X-Category: Action Bars
|
## X-Category: Action Bars
|
||||||
## Version: 4.0
|
## Version: 4.0
|
||||||
|
|||||||
+13
-2
@@ -15,6 +15,8 @@ local format = string.format
|
|||||||
local IsUsableAction = IsUsableAction
|
local IsUsableAction = IsUsableAction
|
||||||
local IsActionInRange = IsActionInRange
|
local IsActionInRange = IsActionInRange
|
||||||
|
|
||||||
|
local LBF = LibStub("LibButtonFacade", true)
|
||||||
|
|
||||||
Bartender4.Button = {}
|
Bartender4.Button = {}
|
||||||
Bartender4.Button.prototype = Button
|
Bartender4.Button.prototype = Button
|
||||||
function Bartender4.Button:Create(id, parent)
|
function Bartender4.Button:Create(id, parent)
|
||||||
@@ -100,6 +102,17 @@ function Bartender4.Button:Create(id, parent)
|
|||||||
--button:Show()
|
--button:Show()
|
||||||
--button:UpdateAction(true)
|
--button:UpdateAction(true)
|
||||||
|
|
||||||
|
if LBF and parent.LBFGroup then
|
||||||
|
local group = parent.LBFGroup
|
||||||
|
button.LBFButtonData = {
|
||||||
|
Button = button.Proxy,
|
||||||
|
Highlight = button:GetHighlightTexture(),
|
||||||
|
Pushed = button:GetPushedTexture(),
|
||||||
|
Checked = button:GetCheckedTexture(),
|
||||||
|
}
|
||||||
|
group:AddButton(button.Proxy, button.LBFButtonData)
|
||||||
|
end
|
||||||
|
|
||||||
return button
|
return button
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -167,8 +180,6 @@ function onUpdate(self, elapsed)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Button.ApplyStyle = Bartender4.ButtonStyle.ApplyStyle
|
|
||||||
|
|
||||||
function Button:SetStateAction(state, action)
|
function Button:SetStateAction(state, action)
|
||||||
for i=1,2 do
|
for i=1,2 do
|
||||||
self:SetAttribute(("*action-S%d%d"):format(state, i), action)
|
self:SetAttribute(("*action-S%d%d"):format(state, i), action)
|
||||||
|
|||||||
+6
-23
@@ -9,16 +9,21 @@ local ButtonBar_MT = {__index = ButtonBar}
|
|||||||
local defaults = Bartender4:Merge({
|
local defaults = Bartender4:Merge({
|
||||||
padding = 2,
|
padding = 2,
|
||||||
rows = 1,
|
rows = 1,
|
||||||
style = "dream",
|
|
||||||
}, Bartender4.Bar.defaults)
|
}, Bartender4.Bar.defaults)
|
||||||
|
|
||||||
Bartender4.ButtonBar = {}
|
Bartender4.ButtonBar = {}
|
||||||
Bartender4.ButtonBar.prototype = ButtonBar
|
Bartender4.ButtonBar.prototype = ButtonBar
|
||||||
Bartender4.ButtonBar.defaults = defaults
|
Bartender4.ButtonBar.defaults = defaults
|
||||||
|
|
||||||
|
local LBF = LibStub("LibButtonFacade", true)
|
||||||
|
|
||||||
function Bartender4.ButtonBar:Create(id, template, config)
|
function Bartender4.ButtonBar:Create(id, template, config)
|
||||||
local bar = setmetatable(Bartender4.Bar:Create(id, template, config), ButtonBar_MT)
|
local bar = setmetatable(Bartender4.Bar:Create(id, template, config), ButtonBar_MT)
|
||||||
|
|
||||||
|
if LBF then
|
||||||
|
bar.LBFGroup = LBF:Group("Bartender4", tostring(id))
|
||||||
|
end
|
||||||
|
|
||||||
return bar
|
return bar
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -35,7 +40,6 @@ do
|
|||||||
optionMap = {
|
optionMap = {
|
||||||
rows = "Rows",
|
rows = "Rows",
|
||||||
padding = "Padding",
|
padding = "Padding",
|
||||||
style = "Style",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-- retrieves a valid bar object from the barregistry table
|
-- retrieves a valid bar object from the barregistry table
|
||||||
@@ -80,15 +84,6 @@ function ButtonBar:GetOptionObject()
|
|||||||
set = optSetter,
|
set = optSetter,
|
||||||
get = optGetter,
|
get = optGetter,
|
||||||
},
|
},
|
||||||
style = {
|
|
||||||
order = 59,
|
|
||||||
name = "Style",
|
|
||||||
type = "select",
|
|
||||||
desc = "Button Style",
|
|
||||||
values = Bartender4.ButtonStyle:GetStyles(),
|
|
||||||
set = optSetter,
|
|
||||||
get = optGetter,
|
|
||||||
},
|
|
||||||
rows = {
|
rows = {
|
||||||
order = 70,
|
order = 70,
|
||||||
name = "Rows",
|
name = "Rows",
|
||||||
@@ -171,18 +166,6 @@ function ButtonBar:UpdateButtonLayout()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ButtonBar:GetStyle()
|
|
||||||
return self.config.style
|
|
||||||
end
|
|
||||||
|
|
||||||
function ButtonBar:SetStyle(style)
|
|
||||||
if style then
|
|
||||||
self.config.style = style
|
|
||||||
end
|
|
||||||
self:ForAll("ApplyStyle", self.config.style)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
--[[===================================================================================
|
--[[===================================================================================
|
||||||
Utility function
|
Utility function
|
||||||
===================================================================================]]--
|
===================================================================================]]--
|
||||||
|
|||||||
@@ -4,89 +4,3 @@
|
|||||||
|
|
||||||
--[[ $Id$ ]]
|
--[[ $Id$ ]]
|
||||||
|
|
||||||
Bartender4.ButtonStyle = {}
|
|
||||||
|
|
||||||
local styles = {
|
|
||||||
["default"] = "Default",
|
|
||||||
["zoom"] = "Full Zoom",
|
|
||||||
["dream"] = "Dreamlayout",
|
|
||||||
}
|
|
||||||
|
|
||||||
local styledata = {
|
|
||||||
["default"] = {},
|
|
||||||
["zoom"] = { texCoord = {0.07, 0.93, 0.07, 0.93} },
|
|
||||||
["dream"] = {
|
|
||||||
texCoord = {0.08,0.92,0.08,0.92},
|
|
||||||
padding = 3,
|
|
||||||
overlay = true,
|
|
||||||
FrameFunc = function(button)
|
|
||||||
button = button.Proxy or button
|
|
||||||
local name = button:GetName().."DreamLayout"
|
|
||||||
local frame = _G[name] or CreateFrame("Frame", name, button)
|
|
||||||
frame:ClearAllPoints()
|
|
||||||
frame:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 1, edgeFile = "", edgeSize = 0, insets = {left = 0, right = 0, top = 0, bottom = 0},})
|
|
||||||
frame:SetBackdropColor(0, 0, 0, 0.6)
|
|
||||||
frame:SetAllPoints(button)
|
|
||||||
frame:SetFrameLevel(button:GetFrameLevel() - 2)
|
|
||||||
frame:Show()
|
|
||||||
frame.type = "dream"
|
|
||||||
frame.hidegrid = true
|
|
||||||
return frame
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
local cydb
|
|
||||||
|
|
||||||
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
|
|
||||||
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
|
|
||||||
button.overlay:Hide()
|
|
||||||
button.overlay = nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if cy then return end
|
|
||||||
|
|
||||||
if style.texCoord then
|
|
||||||
button.icon:SetTexCoord(unpack(style.texCoord))
|
|
||||||
else
|
|
||||||
button.icon:SetTexCoord(0,1,0,1)
|
|
||||||
end
|
|
||||||
|
|
||||||
button.icon:ClearAllPoints()
|
|
||||||
if style.padding then
|
|
||||||
button.icon:SetPoint("TOPLEFT", button, "TOPLEFT", style.padding, -style.padding)
|
|
||||||
button.icon:SetPoint("BOTTOMRIGHT",button, "BOTTOMRIGHT", -style.padding, style.padding)
|
|
||||||
else
|
|
||||||
button.icon:SetAllPoints(button)
|
|
||||||
end
|
|
||||||
|
|
||||||
if type(button.Update) == "function" then
|
|
||||||
button:Update()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function Bartender4.ButtonStyle:GetStyles()
|
|
||||||
return styles
|
|
||||||
end
|
|
||||||
|
|
||||||
function Bartender4:cyLoaded()
|
|
||||||
cydb = cyCircled_Bartender4 and cyCircled_Bartender4.db
|
|
||||||
Bartender4.Bar:ForAll("SetStyle")
|
|
||||||
end
|
|
||||||
|
|||||||
@@ -266,9 +266,6 @@ function PetButtonPrototype:UpdateCooldown()
|
|||||||
CooldownFrame_SetTimer(self.cooldown, start, duration, enable)
|
CooldownFrame_SetTimer(self.cooldown, start, duration, enable)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- import style function
|
|
||||||
PetButtonPrototype.ApplyStyle = Bartender4.ButtonStyle.ApplyStyle
|
|
||||||
|
|
||||||
function PetButtonPrototype:GetHotkey()
|
function PetButtonPrototype:GetHotkey()
|
||||||
local key = GetBindingKey(format("BONUSACTIONBUTTON%d", self:GetID())) or GetBindingKey("CLICK "..self:GetName()..":LeftButton")
|
local key = GetBindingKey(format("BONUSACTIONBUTTON%d", self:GetID())) or GetBindingKey("CLICK "..self:GetName()..":LeftButton")
|
||||||
return key and KeyBound:ToShortKey(key)
|
return key and KeyBound:ToShortKey(key)
|
||||||
|
|||||||
+10
-2
@@ -14,6 +14,8 @@ local StanceButton_MT = {__index = StanceButtonPrototype}
|
|||||||
|
|
||||||
local format = string.format
|
local format = string.format
|
||||||
|
|
||||||
|
local LBF = LibStub("LibButtonFacade", true)
|
||||||
|
|
||||||
local defaults = { profile = Bartender4:Merge({
|
local defaults = { profile = Bartender4:Merge({
|
||||||
enabled = true,
|
enabled = true,
|
||||||
scale = 1.5,
|
scale = 1.5,
|
||||||
@@ -143,8 +145,6 @@ function StanceButtonPrototype:Update()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
StanceButtonPrototype.ApplyStyle = Bartender4.ButtonStyle.ApplyStyle
|
|
||||||
|
|
||||||
function StanceButtonPrototype:GetHotkey()
|
function StanceButtonPrototype:GetHotkey()
|
||||||
local key = GetBindingKey(format("SHAPESHIFTBUTTON%d", self:GetID())) or GetBindingKey("CLICK "..self:GetName()..":LeftButton")
|
local key = GetBindingKey(format("SHAPESHIFTBUTTON%d", self:GetID())) or GetBindingKey("CLICK "..self:GetName()..":LeftButton")
|
||||||
return key and KeyBound:ToShortKey(key)
|
return key and KeyBound:ToShortKey(key)
|
||||||
@@ -208,6 +208,14 @@ function StanceBarMod:CreateStanceButton(id)
|
|||||||
button.OnEnter = button:GetScript("OnEnter")
|
button.OnEnter = button:GetScript("OnEnter")
|
||||||
button:SetScript("OnEnter", onEnter)
|
button:SetScript("OnEnter", onEnter)
|
||||||
|
|
||||||
|
if LBF then
|
||||||
|
local group = self.bar.LBFGroup
|
||||||
|
button.LBFButtonData = {
|
||||||
|
Button = button
|
||||||
|
}
|
||||||
|
group:AddButton(button, button.LBFButtonData)
|
||||||
|
end
|
||||||
|
|
||||||
return button
|
return button
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user