create bars in OnEnable so blizzard frame positioning code doesnt screw us
This commit is contained in:
+6
-8
@@ -21,22 +21,20 @@ local defaults = {
|
|||||||
local actionbars = {}
|
local actionbars = {}
|
||||||
function BT4ActionBars:OnInitialize()
|
function BT4ActionBars:OnInitialize()
|
||||||
self.db = Bartender4.db:RegisterNamespace("ActionBars", defaults)
|
self.db = Bartender4.db:RegisterNamespace("ActionBars", defaults)
|
||||||
|
end
|
||||||
|
|
||||||
|
function BT4ActionBars:OnEnable()
|
||||||
for i=1,10 do
|
for i=1,10 do
|
||||||
actionbars[i] = self:Create(i, self.db.profile.Bars[i])
|
actionbars[i] = self:Create(i, self.db.profile.Bars[i])
|
||||||
end
|
end
|
||||||
|
|
||||||
self.db.RegisterCallback(self, "OnProfileChanged", "ApplyConfig")
|
self.db.RegisterCallback(self, "OnProfileChanged", "ApplyConfig")
|
||||||
self.db.RegisterCallback(self, "OnProfileCopied", "ApplyConfig")
|
self.db.RegisterCallback(self, "OnProfileCopied", "ApplyConfig")
|
||||||
end
|
end
|
||||||
|
|
||||||
function BT4ActionBars:OnEnable()
|
|
||||||
-- do stuff
|
|
||||||
end
|
|
||||||
|
|
||||||
function BT4ActionBars:ApplyConfig()
|
function BT4ActionBars:ApplyConfig()
|
||||||
for i,v in ipairs(actionbars) do
|
for i,v in ipairs(actionbars) do
|
||||||
v:ApplyConfig(self.db.profile.Bars[k])
|
v:ApplyConfig(self.db.profile.Bars[i])
|
||||||
|
v:Unlock()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -53,7 +51,7 @@ function BT4ActionBars:Create(id, config)
|
|||||||
-- TODO: Setup Buttons and set bar width before pulling initial position
|
-- TODO: Setup Buttons and set bar width before pulling initial position
|
||||||
|
|
||||||
bar:ApplyConfig()
|
bar:ApplyConfig()
|
||||||
-- for debugging only
|
-- debugging
|
||||||
bar:Unlock()
|
bar:Unlock()
|
||||||
|
|
||||||
return bar
|
return bar
|
||||||
|
|||||||
Reference in New Issue
Block a user