Fixed issues with position saving and reseting profiles

This commit is contained in:
Hendrik Leppkes
2008-11-11 16:13:49 +01:00
parent 7f57e78c61
commit 90c58593b9
8 changed files with 42 additions and 19 deletions
+1 -2
View File
@@ -19,8 +19,7 @@ end
function ActionBar:ApplyConfig(config) function ActionBar:ApplyConfig(config)
ButtonBar.ApplyConfig(self, config) ButtonBar.ApplyConfig(self, config)
config = self.config if not self.config.position then initialPosition(self) end
if not config.position then initialPosition(self) end
self:UpdateButtons() self:UpdateButtons()
self:UpdateSelfCast(true) self:UpdateSelfCast(true)
+6 -2
View File
@@ -30,8 +30,6 @@ local noopFunc = function() end
function BagBarMod:OnEnable() function BagBarMod:OnEnable()
if not self.bar then if not self.bar then
self.bar = setmetatable(Bartender4.ButtonBar:Create("BagBar", self.db.profile, L["Bag Bar"]), {__index = BagBar}) self.bar = setmetatable(Bartender4.ButtonBar:Create("BagBar", self.db.profile, L["Bag Bar"]), {__index = BagBar})
self.bar:SetPoint("CENTER", 142, -18)
end end
self.bar:Enable() self.bar:Enable()
self:ToggleOptions() self:ToggleOptions()
@@ -44,6 +42,12 @@ end
function BagBar:ApplyConfig(config) function BagBar:ApplyConfig(config)
ButtonBar.ApplyConfig(self, config) ButtonBar.ApplyConfig(self, config)
if not self.config.position then
self:ClearSetPoint("CENTER", 142, -18)
self:SavePosition()
end
self:FeedButtons() self:FeedButtons()
self:UpdateButtonLayout() self:UpdateButtonLayout()
end end
+1
View File
@@ -59,6 +59,7 @@ do
parent:StopMovingOrSizing() parent:StopMovingOrSizing()
end end
parent:SavePosition() parent:SavePosition()
parent.isMoving = nil
end end
end end
+10
View File
@@ -128,6 +128,12 @@ function Bartender4:RegisterDefaultsKey(key, subdefaults)
end end
function Bartender4:UpdateModuleConfigs() function Bartender4:UpdateModuleConfigs()
local unlock = false
if not self.Locked then
self:Lock()
unlock = true
end
for k,v in AceAddon:IterateModulesOfAddon(self) do for k,v in AceAddon:IterateModulesOfAddon(self) do
v:ToggleModule() v:ToggleModule()
if v:IsEnabled() and type(v.ApplyConfig) == "function" then if v:IsEnabled() and type(v.ApplyConfig) == "function" then
@@ -137,6 +143,10 @@ function Bartender4:UpdateModuleConfigs()
if LDB and LDBIcon then if LDB and LDBIcon then
LDBIcon:Refresh("Bartender4", Bartender4.db.profile.minimapIcon) LDBIcon:Refresh("Bartender4", Bartender4.db.profile.minimapIcon)
end end
if unlock then
self:Unlock()
end
end end
function Bartender4:CombatLockdown() function Bartender4:CombatLockdown()
+6 -2
View File
@@ -52,8 +52,6 @@ function MicroMenuMod:OnEnable()
v:SetFrameLevel(self.bar:GetFrameLevel() + 1) v:SetFrameLevel(self.bar:GetFrameLevel() + 1)
v.ClearSetPoint = self.bar.ClearSetPoint v.ClearSetPoint = self.bar.ClearSetPoint
end end
self.bar:SetPoint("CENTER", -105, 27)
end end
self.bar:Enable() self.bar:Enable()
self:ToggleOptions() self:ToggleOptions()
@@ -69,5 +67,11 @@ MicroMenuBar.button_height = 58
MicroMenuBar.vpad_offset = -21 MicroMenuBar.vpad_offset = -21
function MicroMenuBar:ApplyConfig(config) function MicroMenuBar:ApplyConfig(config)
ButtonBar.ApplyConfig(self, config) ButtonBar.ApplyConfig(self, config)
if not self.config.position then
self:ClearSetPoint("CENTER", -105, 27)
self:SavePosition()
end
self:UpdateButtonLayout() self:UpdateButtonLayout()
end end
+6 -5
View File
@@ -33,12 +33,7 @@ function PetBarMod:OnEnable()
end end
self.bar.buttons = buttons self.bar.buttons = buttons
-- TODO: real positioning
self.bar:ClearSetPoint("CENTER", 0, 70)
self.bar:SetScript("OnEvent", PetBar.OnEvent) self.bar:SetScript("OnEvent", PetBar.OnEvent)
--self.bar:SetAttribute("unit", "pet")
end end
self.bar:Enable() self.bar:Enable()
@@ -99,6 +94,12 @@ end
function PetBar:ApplyConfig(config) function PetBar:ApplyConfig(config)
ButtonBar.ApplyConfig(self, config) ButtonBar.ApplyConfig(self, config)
if not self.config.position then
self:ClearSetPoint("CENTER", 0, 70)
self:SavePosition()
end
self:UpdateButtonLayout() self:UpdateButtonLayout()
self:ForAll("Update") self:ForAll("Update")
self:ForAll("ApplyStyle", self.config.style) self:ForAll("ApplyStyle", self.config.style)
+6 -6
View File
@@ -30,9 +30,6 @@ function RepBarMod:OnEnable()
self.bar.content:SetParent(self.bar) self.bar.content:SetParent(self.bar)
self.bar.content:Show() self.bar.content:Show()
self.bar.content:SetFrameLevel(self.bar:GetFrameLevel() + 1) self.bar.content:SetFrameLevel(self.bar:GetFrameLevel() + 1)
-- TODO: real start position
self.bar:SetPoint("CENTER")
end end
self.bar:Enable() self.bar:Enable()
self:ToggleOptions() self:ToggleOptions()
@@ -45,6 +42,12 @@ end
function RepBar:ApplyConfig(config) function RepBar:ApplyConfig(config)
Bar.ApplyConfig(self, config) Bar.ApplyConfig(self, config)
if not self.config.position then
self:ClearSetPoint("CENTER")
self:SavePosition()
end
self:PerformLayout() self:PerformLayout()
end end
@@ -74,9 +77,6 @@ function XPBarMod:OnEnable()
self.bar.content:SetParent(self.bar) self.bar.content:SetParent(self.bar)
self.bar.content:Show() self.bar.content:Show()
self.bar.content:SetFrameLevel(self.bar:GetFrameLevel() + 1) self.bar.content:SetFrameLevel(self.bar:GetFrameLevel() + 1)
-- TODO: real start position
self.bar:SetPoint("CENTER")
end end
self.bar:Enable() self.bar:Enable()
self:ToggleOptions() self:ToggleOptions()
+6 -2
View File
@@ -29,8 +29,6 @@ end
function StanceBarMod:OnEnable() function StanceBarMod:OnEnable()
if not self.bar then if not self.bar then
self.bar = setmetatable(Bartender4.ButtonBar:Create("StanceBar", self.db.profile, L["Stance Bar"]), {__index = StanceBar}) 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) self.bar:SetScript("OnEvent", StanceBar.OnEvent)
end end
self.bar:Enable() self.bar:Enable()
@@ -207,6 +205,12 @@ end
function StanceBar:ApplyConfig(config) function StanceBar:ApplyConfig(config)
ButtonBar.ApplyConfig(self, config) ButtonBar.ApplyConfig(self, config)
if not self.config.position then
self:ClearSetPoint("CENTER", -55, -10)
self:SavePosition()
end
self:UpdateStanceButtons() self:UpdateStanceButtons()
self:ForAll("ApplyStyle", self.config.style) self:ForAll("ApplyStyle", self.config.style)
end end