Fixed issues with position saving and reseting profiles
This commit is contained in:
+1
-2
@@ -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)
|
||||
|
||||
+6
-2
@@ -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
|
||||
|
||||
@@ -59,6 +59,7 @@ do
|
||||
parent:StopMovingOrSizing()
|
||||
end
|
||||
parent:SavePosition()
|
||||
parent.isMoving = nil
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
+6
-2
@@ -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
|
||||
|
||||
+6
-5
@@ -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)
|
||||
|
||||
+6
-6
@@ -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()
|
||||
|
||||
+6
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user