changeset 128:1729a41324d5

Debug channel will now be recreated when it was already found rather than re-used. This should prevent invisible debug frames.
author Zerotorescue
date Tue, 18 Jan 2011 00:18:12 +0100
parents 97fd38fb452d
children 95d1ce0a8ca9
files Core.lua
diffstat 1 files changed, 7 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/Core.lua	Sun Jan 16 01:45:25 2011 +0100
+++ b/Core.lua	Tue Jan 18 00:18:12 2011 +0100
@@ -4,7 +4,7 @@
 
 local _G = _G;
 local sformat, ssplit, slower, strim, smatch = _G.string.format, _G.string.split, _G.string.lower, _G.string.trim, _G.string.match;
-local mfloor, print, pairs, tonumber = _G.math.floor, _G.print, _G.pairs, _G.tonumber;
+local floor, print, pairs, tonumber = _G.floor, _G.print, _G.pairs, _G.tonumber;
 
 --@debug@
 local addonRevision = 1;
@@ -101,11 +101,9 @@
 		for i = 1, NUM_CHAT_WINDOWS do
 			local name = GetChatWindowInfo(i);
 			
-			if name:upper() == "DEBUG" then
-				this.debugChannel = _G["ChatFrame" .. i];
-			
-				addon:Print("A debug channel already exists, used the old one. (" .. i .. ")");
-				return;
+			if string.upper(name) == "DEBUG" then
+				addon:Print("A debug channel already exists, removing the old one... (" .. i .. ")");
+				FCF_Close(_G["ChatFrame" .. i]);
 			end
 		end
 		
@@ -370,19 +368,19 @@
 function addon:ReadableMoney(copper, clean)
 	local text = "";
 	
-	local gold = mfloor( copper / COPPER_PER_GOLD );
+	local gold = floor( copper / COPPER_PER_GOLD );
 	if gold > 0 then
 		text = sformat(goldText, text, gold);
 	end
 	
 	if not clean or (not gold or gold < 10) then
-		local silver = mfloor( ( copper % COPPER_PER_GOLD ) / COPPER_PER_SILVER );
+		local silver = floor( ( copper % COPPER_PER_GOLD ) / COPPER_PER_SILVER );
 		if silver > 0 then
 			text = sformat(silverText, text, silver);
 		end
 		
 		if not clean or (not gold or gold < 1) then
-			local copper = mfloor( copper % COPPER_PER_SILVER );
+			local copper = floor( copper % COPPER_PER_SILVER );
 			if copper > 0 or text == "" then
 				text = sformat(copperText, text, copper);
 			end