From edcb0cb6d7ff480f0028eaac6466466117bf9605 Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Sat, 16 Mar 2013 08:04:37 +0000 Subject: [PATCH] Set the frame anchor during UpdateFrame() instead of OnInitialize(). This moves referencing the anchor stored in the profile to a later point where if the profile is changed, the anchor in the new profile is used to update the frame, and is needed for online profile-switching. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@785 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- Ovale.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Ovale.lua b/Ovale.lua index 59b7ff5..8fc5b3a 100644 --- a/Ovale.lua +++ b/Ovale.lua @@ -92,10 +92,8 @@ function Ovale:OnEnable() self:RegisterEvent("CHAT_MSG_ADDON") OvaleOptions = Ovale:GetModule("OvaleOptions") - local profile = OvaleOptions:GetProfile() self.frame = LibStub("AceGUI-3.0"):Create("OvaleFrame") - self.frame:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", profile.left, profile.top) self:UpdateFrame() end @@ -208,6 +206,9 @@ function Ovale:UpdateVisibility() end function Ovale:UpdateFrame() + local profile = OvaleOptions:GetProfile() + self.frame:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", profile.left, profile.top) + self.frame:ReleaseChildren() self.frame:UpdateIcons() @@ -216,8 +217,6 @@ function Ovale:UpdateFrame() self.checkBoxes = {} - local profile = OvaleOptions:GetProfile() - for k,checkBox in pairs(self.casesACocher) do self.checkBoxes[k] = LibStub("AceGUI-3.0"):Create("CheckBox"); self.frame:AddChild(self.checkBoxes[k]) -- 1.7.9.5