Quantcast

-Fix for an error that would occur if the chatframes were locked and the addon would try to move them.

Xruptor [09-27-12 - 22:29]
-Fix for an error that would occur if the chatframes were locked and the addon would try to move them.
Filename
XanChat.lua
XanChat.toc
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