diff Core.lua @ 98:252292b703ce

All print(...) function calls are now handled by addon:Print(text, color). The cursor will be cleared of any items/spells before moving as well as when aborting.
author Zerotorescue
date Sun, 09 Jan 2011 17:49:33 +0100
parents 31493364b163
children 6ae44d372360
line wrap: on
line diff
--- a/Core.lua	Sun Jan 09 01:34:05 2011 +0100
+++ b/Core.lua	Sun Jan 09 17:49:33 2011 +0100
@@ -93,7 +93,7 @@
 			if name:upper() == "DEBUG" then
 				this.debugChannel = _G["ChatFrame" .. i];
 			
-				print("A debug channel already exists, used the old one. (" .. i .. ")");
+				addon:Print("A debug channel already exists, used the old one. (" .. i .. ")");
 				return;
 			end
 		end
@@ -104,7 +104,7 @@
 			ChatFrame_RemoveAllMessageGroups(chatFrame);
 			this.debugChannel = chatFrame;
 			
-			print("New debug channel created.");
+			addon:Print("New debug channel created.");
 		end
 	end, { "d", "debug" });
 
@@ -133,10 +133,10 @@
 		if not self.db.global.version then
 			-- Old version was before version was saved, many changes were done in that revision
 			
-			print("Updating Inventorium database from version " .. (self.db.global.version or "Unknown") .. " to version " .. addonRevision .. "...");
+			addon:Print("Updating Inventorium database from version " .. (self.db.global.version or "Unknown") .. " to version " .. addonRevision .. "...");
 			
 			if self.db.global and self.db.global.defaults then
-				print("Moving all global data into your current profile...");
+				addon:Print("Moving all global data into your current profile...");
 				
 				-- All data mustn't be global but profile-based
 				self.db.profile.defaults = CopyTable(self.db.global.defaults);
@@ -152,7 +152,7 @@
 			end
 			
 			if self.db.profile.defaults.minimumStock then
-				print("Copying the minimum stock value into the minimum global stock...");
+				addon:Print("Copying the minimum stock value into the minimum global stock...");
 				
 				-- We added another stock option and renamed the old to be more obvious about what it means
 				self.db.profile.defaults.minGlobalStock = self.db.profile.defaults.minimumStock;
@@ -160,7 +160,7 @@
 			end
 			
 			if self.db.profile.defaults.minimumLocalStock then
-				print("Renaming the minimum local stock property...");
+				addon:Print("Renaming the minimum local stock property...");
 				
 				-- We added another stock option and then renamed it
 				self.db.profile.defaults.minLocalStock = self.db.profile.defaults.minimumLocalStock;
@@ -168,7 +168,7 @@
 			end
 			
 			if self.db.profile.defaults.alertBelowMinimum then
-				print("Copying the alert below minimum value into the alert below global minimum value...");
+				addon:Print("Copying the alert below minimum value into the alert below global minimum value...");
 				
 				-- We added another stock option and then renamed it
 				self.db.profile.defaults.alertBelowGlobalMinimum = self.db.profile.defaults.alertBelowMinimum;
@@ -306,7 +306,7 @@
 		-- Pass a reference to the addon (to be used as "self") and the provided arg
 		slashArgs[cmd](addon, arg);
 	else
-		print(slashError);
+		addon:Print(slashError);
 	end
 end
 
@@ -426,7 +426,11 @@
 
 addon.Colors = {
 	Red = { 1, 0, 0 },
+	Orange = { 1, .46, .1 },
 	Green = { 0, 1, 0 },
+	Blue = { 0, 0, 1 },
+	Yellow = { 1, 1, 0 },
+	Cyan = { 0, 1, 1 },
 }; -- easy to extend if more colors are needed
 function addon:Print(text, color)
 	local red, green, blue;