diff Modules/Utils.lua @ 16:56de19d9bd8d

Cleaned up the messages. You can turn the notifications of price changes off and those messages will only show gold or silver if they are more than 0. I have also removed the dependency on AceConsole because it doesn't allow changing the color of the addon name when I print messages.
author Asa Ayers <Asa.Ayers@Gmail.com>
date Sat, 03 Jul 2010 10:05:53 -0700
parents 44e70a3fdb19
children ff9a698caebc
line wrap: on
line diff
--- a/Modules/Utils.lua	Sat Jul 03 07:40:01 2010 -0700
+++ b/Modules/Utils.lua	Sat Jul 03 10:05:53 2010 -0700
@@ -4,12 +4,33 @@
 addonTable.utils = addon
 IAUtils = addon
 
-function addon:FormatMoney(money)
+function addon:FormatMoney(copper)
+	color = "|cFFFFFFFF"
 	local prefix = ""
-	if money < 0 then
+	if copper < 0 then
 		prefix = "-"
+		copper = abs(copper)
 	end
-	return prefix .. Altoholic:GetMoneyString(abs(money), WHITE, false)
+
+	local gold = floor( copper / 10000 );
+	copper = mod(copper, 10000)
+	local silver = floor( copper / 100 );
+	copper = mod(copper, 100)
+	
+	
+	copper = color..format(COPPER_AMOUNT_TEXTURE, copper, 13, 13)
+	if silver > 0 or gold > 0 then
+		silver = color..format(SILVER_AMOUNT_TEXTURE, silver, 13, 13) .. ' '
+	else
+		silver = ""
+	end
+	if gold > 0 then
+		gold = color..format(GOLD_AMOUNT_TEXTURE, gold, 13, 13) .. ' '
+	else
+		gold = ""
+	end
+	
+	return format("%s%s%s%s", prefix, gold, silver, copper)
 end
 
 -- This is only here to make sure this doesn't blow up if ReplaceItemCache is never called