diff --git a/ActionBar.lua b/ActionBar.lua index 7448564..9fbd15b 100644 --- a/ActionBar.lua +++ b/ActionBar.lua @@ -19,8 +19,7 @@ end function ActionBar:ApplyConfig(config) ButtonBar.ApplyConfig(self, config) - config = self.config - if not config.position then initialPosition(self) end + if not self.config.position then initialPosition(self) end self:UpdateButtons() self:UpdateSelfCast(true) diff --git a/BagBar.lua b/BagBar.lua index def65be..f472fa8 100644 --- a/BagBar.lua +++ b/BagBar.lua @@ -30,8 +30,6 @@ local noopFunc = function() end function BagBarMod:OnEnable() if not self.bar then self.bar = setmetatable(Bartender4.ButtonBar:Create("BagBar", self.db.profile, L["Bag Bar"]), {__index = BagBar}) - - self.bar:SetPoint("CENTER", 142, -18) end self.bar:Enable() self:ToggleOptions() @@ -44,6 +42,12 @@ end function BagBar:ApplyConfig(config) ButtonBar.ApplyConfig(self, config) + + if not self.config.position then + self:ClearSetPoint("CENTER", 142, -18) + self:SavePosition() + end + self:FeedButtons() self:UpdateButtonLayout() end diff --git a/Bar.lua b/Bar.lua index 26d0ecb..0947ddd 100644 --- a/Bar.lua +++ b/Bar.lua @@ -59,6 +59,7 @@ do parent:StopMovingOrSizing() end parent:SavePosition() + parent.isMoving = nil end end diff --git a/Bartender4.lua b/Bartender4.lua index c0fb50a..11a1e65 100644 --- a/Bartender4.lua +++ b/Bartender4.lua @@ -128,6 +128,12 @@ function Bartender4:RegisterDefaultsKey(key, subdefaults) end function Bartender4:UpdateModuleConfigs() + local unlock = false + if not self.Locked then + self:Lock() + unlock = true + end + for k,v in AceAddon:IterateModulesOfAddon(self) do v:ToggleModule() if v:IsEnabled() and type(v.ApplyConfig) == "function" then @@ -137,6 +143,10 @@ function Bartender4:UpdateModuleConfigs() if LDB and LDBIcon then LDBIcon:Refresh("Bartender4", Bartender4.db.profile.minimapIcon) end + + if unlock then + self:Unlock() + end end function Bartender4:CombatLockdown() diff --git a/MicroMenu.lua b/MicroMenu.lua index e504b4f..c792837 100644 --- a/MicroMenu.lua +++ b/MicroMenu.lua @@ -52,8 +52,6 @@ function MicroMenuMod:OnEnable() v:SetFrameLevel(self.bar:GetFrameLevel() + 1) v.ClearSetPoint = self.bar.ClearSetPoint end - - self.bar:SetPoint("CENTER", -105, 27) end self.bar:Enable() self:ToggleOptions() @@ -69,5 +67,11 @@ MicroMenuBar.button_height = 58 MicroMenuBar.vpad_offset = -21 function MicroMenuBar:ApplyConfig(config) ButtonBar.ApplyConfig(self, config) + + if not self.config.position then + self:ClearSetPoint("CENTER", -105, 27) + self:SavePosition() + end + self:UpdateButtonLayout() end diff --git a/PetBar.lua b/PetBar.lua index 90e027e..1e8da54 100644 --- a/PetBar.lua +++ b/PetBar.lua @@ -33,12 +33,7 @@ function PetBarMod:OnEnable() end self.bar.buttons = buttons - -- TODO: real positioning - self.bar:ClearSetPoint("CENTER", 0, 70) - self.bar:SetScript("OnEvent", PetBar.OnEvent) - - --self.bar:SetAttribute("unit", "pet") end self.bar:Enable() @@ -99,6 +94,12 @@ end function PetBar:ApplyConfig(config) ButtonBar.ApplyConfig(self, config) + + if not self.config.position then + self:ClearSetPoint("CENTER", 0, 70) + self:SavePosition() + end + self:UpdateButtonLayout() self:ForAll("Update") self:ForAll("ApplyStyle", self.config.style) diff --git a/RepXPBar.lua b/RepXPBar.lua index 1d8ed89..e179a51 100644 --- a/RepXPBar.lua +++ b/RepXPBar.lua @@ -30,9 +30,6 @@ function RepBarMod:OnEnable() self.bar.content:SetParent(self.bar) self.bar.content:Show() self.bar.content:SetFrameLevel(self.bar:GetFrameLevel() + 1) - - -- TODO: real start position - self.bar:SetPoint("CENTER") end self.bar:Enable() self:ToggleOptions() @@ -45,6 +42,12 @@ end function RepBar:ApplyConfig(config) Bar.ApplyConfig(self, config) + + if not self.config.position then + self:ClearSetPoint("CENTER") + self:SavePosition() + end + self:PerformLayout() end @@ -74,9 +77,6 @@ function XPBarMod:OnEnable() self.bar.content:SetParent(self.bar) self.bar.content:Show() self.bar.content:SetFrameLevel(self.bar:GetFrameLevel() + 1) - - -- TODO: real start position - self.bar:SetPoint("CENTER") end self.bar:Enable() self:ToggleOptions() diff --git a/StanceBar.lua b/StanceBar.lua index 3ff4bb8..2b1d9f3 100644 --- a/StanceBar.lua +++ b/StanceBar.lua @@ -29,8 +29,6 @@ end function StanceBarMod:OnEnable() if not self.bar then self.bar = setmetatable(Bartender4.ButtonBar:Create("StanceBar", self.db.profile, L["Stance Bar"]), {__index = StanceBar}) - - self.bar:ClearSetPoint("CENTER", -55, -10) self.bar:SetScript("OnEvent", StanceBar.OnEvent) end self.bar:Enable() @@ -207,6 +205,12 @@ end function StanceBar:ApplyConfig(config) ButtonBar.ApplyConfig(self, config) + + if not self.config.position then + self:ClearSetPoint("CENTER", -55, -10) + self:SavePosition() + end + self:UpdateStanceButtons() self:ForAll("ApplyStyle", self.config.style) end