Small improvements to the behaviour of the secure environment. Fixes a rare bug when adding/removing buttons from a bar.
This commit is contained in:
+1
-1
@@ -26,7 +26,6 @@ function ActionBar:ApplyConfig(config)
|
|||||||
if not self.config.position.x then initialPosition(self) end
|
if not self.config.position.x then initialPosition(self) end
|
||||||
|
|
||||||
self:UpdateButtons()
|
self:UpdateButtons()
|
||||||
self:UpdateSelfCast() -- also calls UpdateStates
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Update the number of buttons in our bar, creating new ones if necessary
|
-- Update the number of buttons in our bar, creating new ones if necessary
|
||||||
@@ -71,6 +70,7 @@ function ActionBar:UpdateButtons(numbuttons)
|
|||||||
|
|
||||||
-- need to re-set clickthrough after creating new buttons
|
-- need to re-set clickthrough after creating new buttons
|
||||||
self:SetClickThrough()
|
self:SetClickThrough()
|
||||||
|
self:UpdateSelfCast() -- update selfcast and states
|
||||||
end
|
end
|
||||||
|
|
||||||
function ActionBar:SkinChanged(...)
|
function ActionBar:SkinChanged(...)
|
||||||
|
|||||||
+4
-1
@@ -241,7 +241,7 @@ function onUpdate(self, elapsed)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function updateIcon(self)
|
local function updateIcon(self)
|
||||||
if self.BT4init and self.action then
|
if self.action then
|
||||||
if specialButtons[self.action] then
|
if specialButtons[self.action] then
|
||||||
if not LBF then
|
if not LBF then
|
||||||
self.normalTexture:SetTexCoord(0, 0, 0, 0)
|
self.normalTexture:SetTexCoord(0, 0, 0, 0)
|
||||||
@@ -260,7 +260,10 @@ local function updateIcon(self)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function updateFunc(self)
|
local function updateFunc(self)
|
||||||
|
local parent = self:GetParent()
|
||||||
|
if not self.BT4init or not parent.BT4BarType then return end
|
||||||
updateIcon(self)
|
updateIcon(self)
|
||||||
|
|
||||||
if self.SecureInit and not InCombatLockdown() then
|
if self.SecureInit and not InCombatLockdown() then
|
||||||
local parent = self:GetParent()
|
local parent = self:GetParent()
|
||||||
parent:SetFrameRef("upd", self)
|
parent:SetFrameRef("upd", self)
|
||||||
|
|||||||
@@ -199,6 +199,8 @@ end
|
|||||||
Universal Bar Prototype
|
Universal Bar Prototype
|
||||||
===================================================================================]]--
|
===================================================================================]]--
|
||||||
|
|
||||||
|
Bar.BT4BarType = "Bar"
|
||||||
|
|
||||||
function Bar:ApplyConfig(config)
|
function Bar:ApplyConfig(config)
|
||||||
if config then
|
if config then
|
||||||
self.config = config
|
self.config = config
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ function Bartender4.ButtonBar:SkinChanged(SkinID, Gloss, Backdrop, Group, Button
|
|||||||
bar:SkinChanged(SkinID, Gloss, Backdrop, Colors, Button)
|
bar:SkinChanged(SkinID, Gloss, Backdrop, Colors, Button)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
ButtonBar.BT4BarType = "ButtonBar"
|
||||||
|
|
||||||
function ButtonBar:UpdateSkin()
|
function ButtonBar:UpdateSkin()
|
||||||
if not self.LBFGroup then return end
|
if not self.LBFGroup then return end
|
||||||
local config = self.config
|
local config = self.config
|
||||||
|
|||||||
+7
-1
@@ -35,6 +35,8 @@ function Bartender4.StateBar:Create(id, config, name)
|
|||||||
return bar
|
return bar
|
||||||
end
|
end
|
||||||
|
|
||||||
|
StateBar.BT4BarType = "StateBar"
|
||||||
|
|
||||||
function StateBar:ApplyConfig(config)
|
function StateBar:ApplyConfig(config)
|
||||||
ButtonBar.ApplyConfig(self, config)
|
ButtonBar.ApplyConfig(self, config)
|
||||||
-- We cannot call UpdateStates or UpdateSelfCast now, because the buttons are not yet created *sad*
|
-- We cannot call UpdateStates or UpdateSelfCast now, because the buttons are not yet created *sad*
|
||||||
@@ -158,7 +160,9 @@ function StateBar:UpdateStates(returnOnly)
|
|||||||
]])
|
]])
|
||||||
|
|
||||||
UnregisterStateDriver(self, "page")
|
UnregisterStateDriver(self, "page")
|
||||||
RegisterStateDriver(self, "page", statedriver or "")
|
self:SetAttribute("state-page", "0")
|
||||||
|
|
||||||
|
RegisterStateDriver(self, "page", statedriver or "0")
|
||||||
|
|
||||||
self:SetAttribute("_onstate-assist-help", [[
|
self:SetAttribute("_onstate-assist-help", [[
|
||||||
local state = (newstate ~= "nil") and newstate or nil
|
local state = (newstate ~= "nil") and newstate or nil
|
||||||
@@ -181,7 +185,9 @@ function StateBar:UpdateStates(returnOnly)
|
|||||||
end
|
end
|
||||||
|
|
||||||
UnregisterStateDriver(self, "assist-help")
|
UnregisterStateDriver(self, "assist-help")
|
||||||
|
self:SetAttribute("state-assist-help", "nil")
|
||||||
UnregisterStateDriver(self, "assist-harm")
|
UnregisterStateDriver(self, "assist-harm")
|
||||||
|
self:SetAttribute("state-assist-harm", "nil")
|
||||||
|
|
||||||
if self.config.autoassist then
|
if self.config.autoassist then
|
||||||
RegisterStateDriver(self, "assist-help", ("%s%s[help]nil; [target=targettarget, help]targettarget; nil"):format(preSelf, preFocus))
|
RegisterStateDriver(self, "assist-help", ("%s%s[help]nil; [target=targettarget, help]targettarget; nil"):format(preSelf, preFocus))
|
||||||
|
|||||||
Reference in New Issue
Block a user