Quantcast

-Small fix for scrolling

Xruptor [04-17-12 - 17:21]
-Small fix for scrolling
-layout saved first before restored
Filename
XanChat.lua
XanChat.toc
diff --git a/XanChat.lua b/XanChat.lua
index 737c352..f99f0ac 100644
--- a/XanChat.lua
+++ b/XanChat.lua
@@ -325,10 +325,8 @@ for i = 1, NUM_CHAT_WINDOWS do
 	local n = ("ChatFrame%d"):format(i)
 	local f = _G[n]
 	if f then
-		f:EnableMouseWheel(true)
-		f:SetScript('OnMouseWheel', scrollChat)
+		--have to do this before player login otherwise issues occurr
 		f:SetMaxLines(500)
-		f:SetClampRectInsets(0,0,0,0)
 	end
 end

@@ -366,8 +364,18 @@ function eFrame:PLAYER_LOGIN()

 		if f then

-			--restore saved layout
-			RestoreLayout(f)
+			--delete old DB
+			if XCHT_DB[n] then XCHT_DB[n] = nil end
+
+			--few changes
+			f:EnableMouseWheel(true)
+			f:SetScript('OnMouseWheel', scrollChat)
+			f:SetClampRectInsets(0,0,0,0)
+
+			--check for recent update
+			if XCHT_DB.newLayout == nil and f:IsUserPlaced() then
+				SaveLayout(f)
+			end

 			local editBox = _G[n.."EditBox"]

@@ -423,14 +431,8 @@ function eFrame:PLAYER_LOGIN()
 				f.AddMessage = AddMessage
 			end

-			--delete old DB
-			if XCHT_DB[n] then XCHT_DB[n] = nil end
-
-			--check for recent update
-			if XCHT_DB.newLayout == nil and f:IsUserPlaced() then
-				SaveLayout(f)
-			end
-
+			--restore saved layout
+			RestoreLayout(f)
 		end

 		if XCHT_DB.newLayout == nil then XCHT_DB.newLayout = true end
diff --git a/XanChat.toc b/XanChat.toc
index 31dd3d1..eda4556 100644
--- a/XanChat.toc
+++ b/XanChat.toc
@@ -2,7 +2,7 @@
 ## Title: xanChat
 ## Notes: A very minimalistic chat modification addon.
 ## Author: Xruptor
-## Version: 3.2
+## Version: 3.3
 ## SavedVariables: XCHT_DB

 xanChat.lua