From dd7f0f16455d2343fd9c6aa17ba775202aa8c737 Mon Sep 17 00:00:00 2001 From: zhinjio Date: Fri, 21 Nov 2008 18:57:23 +0000 Subject: [PATCH] AckisRecipeList: - saved window position after initial opening of the frame --- ARLFrame.lua | 39 ++++++++++++++++++++------------------- AckisRecipeList.lua | 2 ++ 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/ARLFrame.lua b/ARLFrame.lua index 169b15f..c1d04fd 100644 --- a/ARLFrame.lua +++ b/ARLFrame.lua @@ -3141,12 +3141,12 @@ end local function SaveFramePosition() - local opts = self.db.profile.frameopts - - local _, _, _, offsetx, offsety = addon.Frame:GetPoint() - - opts.offsetx = offsetx - opts.offsety = offsety + local opts = addon.db.profile.frameopts + local from, _, to, x, y = addon.Frame:GetPoint() + opts.anchorFrom = from + opts.anchorTo = to + opts.offsetx = x + opts.offsety = y end @@ -3274,21 +3274,22 @@ function addon:CreateFrame( addon.Frame:ClearAllPoints() - local opts = self.db.profile.frame - - -- Anchor frame to ATSW - if (ATSWFrame) then - - addon.Frame:SetPoint("CENTER", ATSWFrame, "CENTER", 490, 0) - - elseif (Skillet) then - - addon.Frame:SetPoint("CENTER", SkilletFrame, "CENTER", 468, 0) + local opts = self.db.profile.frameopts + if ( opts.anchorTo == "" ) then + -- no values yet, clamp to whatever frame is appropriate + if (ATSWFrame) then + -- Anchor frame to ATSW + addon.Frame:SetPoint("CENTER", ATSWFrame, "CENTER", 490, 0) + elseif (Skillet) then + -- Anchor frame to Skillet + addon.Frame:SetPoint("CENTER", SkilletFrame, "CENTER", 468, 0) + else + -- Anchor to default tradeskill frame + addon.Frame:SetPoint("TOPLEFT", TradeSkillFrame, "TOPRIGHT", 10, 0 ) + end else - - addon.Frame:SetPoint("CENTER", UIParent, "CENTER", opts.offsetx, opts.offsety) - + addon.Frame:SetPoint( opts.anchorFrom, UOParent, opts.anchorTo, opts.offsetx, opts.offsety ) end addon.Frame:Show() diff --git a/AckisRecipeList.lua b/AckisRecipeList.lua index 037f570..8e8f4fa 100644 --- a/AckisRecipeList.lua +++ b/AckisRecipeList.lua @@ -142,6 +142,8 @@ function addon:OnInitialize() frameopts = { offsetx = 0, offsety = 0, + anchorTo = "", + anchorFrom = "", uiscale = 1, tooltipscale = .9, }, -- 1.7.9.5