changeset 47:4c684bba5777 Prospect Me 2

Added color coding to the "Times Prospected" count to give an idea of the quality of the dataset. Red for low, yellow for ok, green for great!
author Vynn <mischivin@gmail.com>
date Thu, 17 Nov 2016 01:07:51 -0500
parents a35539b8e151
children a2fc078e4d70
files ProspectMe_Tooltip.lua
diffstat 1 files changed, 17 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/ProspectMe_Tooltip.lua	Wed Nov 16 00:47:56 2016 -0500
+++ b/ProspectMe_Tooltip.lua	Thu Nov 17 01:07:51 2016 -0500
@@ -75,21 +75,27 @@
 				local price = ProspectMe.GetItemValue(item)
 				local lifetimeReturn = ProspectMe.GetReturn(item)
 				local subclass = select(7,GetItemInfo(item))
+				local ctp = price * 5
 				--NumofEachQuality, Percent of Each Quality
 				self:AddLine(" ")
-				self:AddLine("Prospect Me",0.5,1,0.5)
+				local color
+					if ProspectMe.Results[item].TimesProspected < 100 then
+						color = "|cffff0000"
+						elseif ProspectMe.Results[item].TimesProspected < 200 then
+							color = "|cffffff00"
+						else
+							color = "|cff00ff00"
+						end
 				if spellid == 225902 or spellid == 225904 or subclass == ProspectMe.Vars.ORE then
-					self:AddLine("Times Prospected: " .. ProspectMe.Results[item].TimesProspected)
+					self:AddDoubleLine("Prospect Me","Times Prospected: " .. color .. ProspectMe.Results[item].TimesProspected,0.5,1,0.5,0.5,0.5,1)
 				elseif spellid == 210116 or subclass == ProspectMe.Vars.HERB then
-					self:AddLine("Times Milled: " .. ProspectMe.Results[item].TimesProspected)
+					self:AddDoubleLine("Prospect Me","Times Milled: " .. color .. ProspectMe.Results[item].TimesProspected,0.5,1,0.5,0.5,0.5,1)
 				else
-					self:AddLine("Times Processed: " .. ProspectMe.Results[item].TimesProspected)
+					self:AddDoubleLine("Prospect Me","Times Processed: " .. color .. ProspectMe.Results[item].TimesProspected,0.5,1,0.5,0.5,0.5,1)
 				end
 				if spellid then
 					ctp = price * 20
 					lifetimeReturn = lifetimeReturn * 4
-				else
-					ctp = price * 5
 				end
 				if spellid == 225902 or spellid == 225904 then
 					self:AddDoubleLine("Cost to Mass Prospect: " .. ProspectMe.FormatPrice(ctp), " Average Return: " .. ProspectMe.FormatPrice(lifetimeReturn))
@@ -103,13 +109,14 @@
 					self:AddDoubleLine("Cost to Process: " .. ProspectMe.FormatPrice(ctp), " Average Return: " .. ProspectMe.FormatPrice(lifetimeReturn))
 				end
 				self:AddLine(" ")
-				local margin = (lifetimeReturn/ctp*100)-100
+				local profit = lifetimeReturn - ctp
+				local margin = (lifetimeReturn / ctp * 100) - 100
 				if margin > 30 then
-					self:AddLine("Estimated Profit: " .. ProspectMe.FormatPrice(lifetimeReturn-(ctp)) .. "\nMargin:  |cff00ff00" .. string.format("[%.1f%%]", margin))
+					self:AddLine("Estimated Profit: " .. ProspectMe.FormatPrice(profit) .. "\nMargin:  |cff00ff00" .. string.format("[%.1f%%]", margin))
 				elseif margin > 15 then
-					self:AddLine("Estimated Profit: " .. ProspectMe.FormatPrice(lifetimeReturn-(ctp)) .. "\nMargin:  |cffffff00" .. string.format("[%.1f%%]", margin))
+					self:AddLine("Estimated Profit: " .. ProspectMe.FormatPrice(profit) .. "\nMargin:  |cffffff00" .. string.format("[%.1f%%]", margin))
 				elseif margin > 0 then
-					self:AddLine("Estimated Profit: " .. ProspectMe.FormatPrice(lifetimeReturn-(ctp)) .. "\nMargin:  |cffff0000" .. string.format("[%.1f%%]", margin))
+					self:AddLine("Estimated Profit: " .. ProspectMe.FormatPrice(profit) .. "\nMargin:  |cffff0000" .. string.format("[%.1f%%]", margin))
 				else
 					self:AddLine("No profit to be made",1,0,0)
 				end