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:
Hendrik Leppkes
2009-04-16 17:04:41 +02:00
parent dc2329544f
commit fe0281fdb7
5 changed files with 16 additions and 3 deletions
+1 -1
View File
@@ -26,7 +26,6 @@ function ActionBar:ApplyConfig(config)
if not self.config.position.x then initialPosition(self) end
self:UpdateButtons()
self:UpdateSelfCast() -- also calls UpdateStates
end
-- 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
self:SetClickThrough()
self:UpdateSelfCast() -- update selfcast and states
end
function ActionBar:SkinChanged(...)
+4 -1
View File
@@ -241,7 +241,7 @@ function onUpdate(self, elapsed)
end
local function updateIcon(self)
if self.BT4init and self.action then
if self.action then
if specialButtons[self.action] then
if not LBF then
self.normalTexture:SetTexCoord(0, 0, 0, 0)
@@ -260,7 +260,10 @@ local function updateIcon(self)
end
local function updateFunc(self)
local parent = self:GetParent()
if not self.BT4init or not parent.BT4BarType then return end
updateIcon(self)
if self.SecureInit and not InCombatLockdown() then
local parent = self:GetParent()
parent:SetFrameRef("upd", self)
+2
View File
@@ -199,6 +199,8 @@ end
Universal Bar Prototype
===================================================================================]]--
Bar.BT4BarType = "Bar"
function Bar:ApplyConfig(config)
if config then
self.config = config
+2
View File
@@ -52,6 +52,8 @@ function Bartender4.ButtonBar:SkinChanged(SkinID, Gloss, Backdrop, Group, Button
bar:SkinChanged(SkinID, Gloss, Backdrop, Colors, Button)
end
ButtonBar.BT4BarType = "ButtonBar"
function ButtonBar:UpdateSkin()
if not self.LBFGroup then return end
local config = self.config
+7 -1
View File
@@ -35,6 +35,8 @@ function Bartender4.StateBar:Create(id, config, name)
return bar
end
StateBar.BT4BarType = "StateBar"
function StateBar:ApplyConfig(config)
ButtonBar.ApplyConfig(self, config)
-- 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")
RegisterStateDriver(self, "page", statedriver or "")
self:SetAttribute("state-page", "0")
RegisterStateDriver(self, "page", statedriver or "0")
self:SetAttribute("_onstate-assist-help", [[
local state = (newstate ~= "nil") and newstate or nil
@@ -181,7 +185,9 @@ function StateBar:UpdateStates(returnOnly)
end
UnregisterStateDriver(self, "assist-help")
self:SetAttribute("state-assist-help", "nil")
UnregisterStateDriver(self, "assist-harm")
self:SetAttribute("state-assist-harm", "nil")
if self.config.autoassist then
RegisterStateDriver(self, "assist-help", ("%s%s[help]nil; [target=targettarget, help]targettarget; nil"):format(preSelf, preFocus))