From e32e6e3b28be4cb7e28d6a18ede997d1c2325d26 Mon Sep 17 00:00:00 2001 From: Xruptor Date: Thu, 27 Sep 2012 18:29:45 -0400 Subject: [PATCH] -Fix for an error that would occur if the chatframes were locked and the addon would try to move them. --- XanChat.lua | 9 ++++++++- XanChat.toc | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/XanChat.lua b/XanChat.lua index f99f0ac..7adfddf 100644 --- a/XanChat.lua +++ b/XanChat.lua @@ -299,8 +299,13 @@ local function RestoreLayout(chatFrame) if ( db.width and db.height ) then chatFrame:SetSize(db.width, db.height) end + + --check to see if we can even move the frame + if not chatFrame:IsMovable() then + chatFrame:SetMovable(true) + end - if ( db.vertPoint and db.horizPoint ) then + if ( db.vertPoint and db.horizPoint and chatFrame:IsMovable() ) then chatFrame:ClearAllPoints() chatFrame:SetPoint(db.vertPoint..db.horizPoint, db.xOffset * GetScreenWidth(), db.yOffset * GetScreenHeight()) chatFrame:SetUserPlaced(true) @@ -308,6 +313,8 @@ local function RestoreLayout(chatFrame) chatFrame:SetUserPlaced(false) end + --don't let the frames get moved around after we set them. Unless the user unlocks it and moves it + chatFrame:SetMovable(false) end --hook origFCF_SavePositionAndDimensions diff --git a/XanChat.toc b/XanChat.toc index 55d5da4..658266e 100644 --- a/XanChat.toc +++ b/XanChat.toc @@ -2,7 +2,7 @@ ## Title: xanChat ## Notes: A very minimalistic chat modification addon. ## Author: Xruptor -## Version: 3.4 +## Version: 3.5 ## SavedVariables: XCHT_DB xanChat.lua -- 1.7.9.5