comparison ProspectMe_Tooltip.lua @ 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
comparison
equal deleted inserted replaced
46:a35539b8e151 47:4c684bba5777
73 if item then 73 if item then
74 if ProspectMe.Results[item] then 74 if ProspectMe.Results[item] then
75 local price = ProspectMe.GetItemValue(item) 75 local price = ProspectMe.GetItemValue(item)
76 local lifetimeReturn = ProspectMe.GetReturn(item) 76 local lifetimeReturn = ProspectMe.GetReturn(item)
77 local subclass = select(7,GetItemInfo(item)) 77 local subclass = select(7,GetItemInfo(item))
78 local ctp = price * 5
78 --NumofEachQuality, Percent of Each Quality 79 --NumofEachQuality, Percent of Each Quality
79 self:AddLine(" ") 80 self:AddLine(" ")
80 self:AddLine("Prospect Me",0.5,1,0.5) 81 local color
82 if ProspectMe.Results[item].TimesProspected < 100 then
83 color = "|cffff0000"
84 elseif ProspectMe.Results[item].TimesProspected < 200 then
85 color = "|cffffff00"
86 else
87 color = "|cff00ff00"
88 end
81 if spellid == 225902 or spellid == 225904 or subclass == ProspectMe.Vars.ORE then 89 if spellid == 225902 or spellid == 225904 or subclass == ProspectMe.Vars.ORE then
82 self:AddLine("Times Prospected: " .. ProspectMe.Results[item].TimesProspected) 90 self:AddDoubleLine("Prospect Me","Times Prospected: " .. color .. ProspectMe.Results[item].TimesProspected,0.5,1,0.5,0.5,0.5,1)
83 elseif spellid == 210116 or subclass == ProspectMe.Vars.HERB then 91 elseif spellid == 210116 or subclass == ProspectMe.Vars.HERB then
84 self:AddLine("Times Milled: " .. ProspectMe.Results[item].TimesProspected) 92 self:AddDoubleLine("Prospect Me","Times Milled: " .. color .. ProspectMe.Results[item].TimesProspected,0.5,1,0.5,0.5,0.5,1)
85 else 93 else
86 self:AddLine("Times Processed: " .. ProspectMe.Results[item].TimesProspected) 94 self:AddDoubleLine("Prospect Me","Times Processed: " .. color .. ProspectMe.Results[item].TimesProspected,0.5,1,0.5,0.5,0.5,1)
87 end 95 end
88 if spellid then 96 if spellid then
89 ctp = price * 20 97 ctp = price * 20
90 lifetimeReturn = lifetimeReturn * 4 98 lifetimeReturn = lifetimeReturn * 4
91 else
92 ctp = price * 5
93 end 99 end
94 if spellid == 225902 or spellid == 225904 then 100 if spellid == 225902 or spellid == 225904 then
95 self:AddDoubleLine("Cost to Mass Prospect: " .. ProspectMe.FormatPrice(ctp), " Average Return: " .. ProspectMe.FormatPrice(lifetimeReturn)) 101 self:AddDoubleLine("Cost to Mass Prospect: " .. ProspectMe.FormatPrice(ctp), " Average Return: " .. ProspectMe.FormatPrice(lifetimeReturn))
96 elseif spellid == 210116 then 102 elseif spellid == 210116 then
97 self:AddDoubleLine("Cost to Mass Mill: " .. ProspectMe.FormatPrice(ctp), " Average Return: " .. ProspectMe.FormatPrice(lifetimeReturn)) 103 self:AddDoubleLine("Cost to Mass Mill: " .. ProspectMe.FormatPrice(ctp), " Average Return: " .. ProspectMe.FormatPrice(lifetimeReturn))
101 self:AddDoubleLine("Cost to Mill: " .. ProspectMe.FormatPrice(ctp), " Average Return: " .. ProspectMe.FormatPrice(lifetimeReturn)) 107 self:AddDoubleLine("Cost to Mill: " .. ProspectMe.FormatPrice(ctp), " Average Return: " .. ProspectMe.FormatPrice(lifetimeReturn))
102 else 108 else
103 self:AddDoubleLine("Cost to Process: " .. ProspectMe.FormatPrice(ctp), " Average Return: " .. ProspectMe.FormatPrice(lifetimeReturn)) 109 self:AddDoubleLine("Cost to Process: " .. ProspectMe.FormatPrice(ctp), " Average Return: " .. ProspectMe.FormatPrice(lifetimeReturn))
104 end 110 end
105 self:AddLine(" ") 111 self:AddLine(" ")
106 local margin = (lifetimeReturn/ctp*100)-100 112 local profit = lifetimeReturn - ctp
113 local margin = (lifetimeReturn / ctp * 100) - 100
107 if margin > 30 then 114 if margin > 30 then
108 self:AddLine("Estimated Profit: " .. ProspectMe.FormatPrice(lifetimeReturn-(ctp)) .. "\nMargin: |cff00ff00" .. string.format("[%.1f%%]", margin)) 115 self:AddLine("Estimated Profit: " .. ProspectMe.FormatPrice(profit) .. "\nMargin: |cff00ff00" .. string.format("[%.1f%%]", margin))
109 elseif margin > 15 then 116 elseif margin > 15 then
110 self:AddLine("Estimated Profit: " .. ProspectMe.FormatPrice(lifetimeReturn-(ctp)) .. "\nMargin: |cffffff00" .. string.format("[%.1f%%]", margin)) 117 self:AddLine("Estimated Profit: " .. ProspectMe.FormatPrice(profit) .. "\nMargin: |cffffff00" .. string.format("[%.1f%%]", margin))
111 elseif margin > 0 then 118 elseif margin > 0 then
112 self:AddLine("Estimated Profit: " .. ProspectMe.FormatPrice(lifetimeReturn-(ctp)) .. "\nMargin: |cffff0000" .. string.format("[%.1f%%]", margin)) 119 self:AddLine("Estimated Profit: " .. ProspectMe.FormatPrice(profit) .. "\nMargin: |cffff0000" .. string.format("[%.1f%%]", margin))
113 else 120 else
114 self:AddLine("No profit to be made",1,0,0) 121 self:AddLine("No profit to be made",1,0,0)
115 end 122 end
116 self:AddLine(" ") 123 self:AddLine(" ")
117 local t 124 local t