comparison ProspectMe_Tooltip.lua @ 48:a2fc078e4d70 Prospect Me 2

Cleaned up formatting a bit in an attempt to streamline and make the data more readable, especially with large sets of results.
author Vynn <mischivin@gmail.com>
date Thu, 17 Nov 2016 02:06:18 -0500
parents 4c684bba5777
children 73a564278360
comparison
equal deleted inserted replaced
47:4c684bba5777 48:a2fc078e4d70
77 local subclass = select(7,GetItemInfo(item)) 77 local subclass = select(7,GetItemInfo(item))
78 local ctp = price * 5 78 local ctp = price * 5
79 --NumofEachQuality, Percent of Each Quality 79 --NumofEachQuality, Percent of Each Quality
80 self:AddLine(" ") 80 self:AddLine(" ")
81 local color 81 local color
82 if ProspectMe.Results[item].TimesProspected < 100 then 82 if ProspectMe.Results[item].TimesProspected < 100 then
83 color = "|cffff0000" 83 color = "|cffff0000"
84 elseif ProspectMe.Results[item].TimesProspected < 200 then 84 elseif ProspectMe.Results[item].TimesProspected < 200 then
85 color = "|cffffff00" 85 color = "|cffffff00"
86 else 86 else
87 color = "|cff00ff00" 87 color = "|cff00ff00"
88 end 88 end
89
90 -- SKill Text Block ""
91 local skilltext
89 if spellid == 225902 or spellid == 225904 or subclass == ProspectMe.Vars.ORE then 92 if spellid == 225902 or spellid == 225904 or subclass == ProspectMe.Vars.ORE then
90 self:AddDoubleLine("Prospect Me","Times Prospected: " .. color .. ProspectMe.Results[item].TimesProspected,0.5,1,0.5,0.5,0.5,1) 93 skilltext = "Prospected"
91 elseif spellid == 210116 or subclass == ProspectMe.Vars.HERB then 94 elseif spellid == 210116 or subclass == ProspectMe.Vars.HERB then
92 self:AddDoubleLine("Prospect Me","Times Milled: " .. color .. ProspectMe.Results[item].TimesProspected,0.5,1,0.5,0.5,0.5,1) 95 skilltext = "Milled"
93 else 96 else
94 self:AddDoubleLine("Prospect Me","Times Processed: " .. color .. ProspectMe.Results[item].TimesProspected,0.5,1,0.5,0.5,0.5,1) 97 skilltext = "Processed"
98 end
99 self:AddDoubleLine("Prospect Me","Times " .. skilltext .. ": " .. color .. ProspectMe.Results[item].TimesProspected,1,0.82,0,1,1,1)
100 self:AddLine(" ")
101
102 -- Economics Text Block
103 local spelltext
104 if spellid == 225902 or spellid == 225904 then
105 spelltext = "Mass Prospect"
106 elseif spellid == 210116 then
107 spelltext = "Mass Mill"
108 elseif subclass == ProspectMe.Vars.ORE then
109 spelltext = "Prospect"
110 elseif subclass == ProspectMe.Vars.HERB then
111 spelltext = "Mill"
112 else
113 spelltext = "Process"
95 end 114 end
96 if spellid then 115 if spellid then
97 ctp = price * 20 116 ctp = price * 20
98 lifetimeReturn = lifetimeReturn * 4 117 lifetimeReturn = lifetimeReturn * 4
99 end 118 end
100 if spellid == 225902 or spellid == 225904 then
101 self:AddDoubleLine("Cost to Mass Prospect: " .. ProspectMe.FormatPrice(ctp), " Average Return: " .. ProspectMe.FormatPrice(lifetimeReturn))
102 elseif spellid == 210116 then
103 self:AddDoubleLine("Cost to Mass Mill: " .. ProspectMe.FormatPrice(ctp), " Average Return: " .. ProspectMe.FormatPrice(lifetimeReturn))
104 elseif subclass == ProspectMe.Vars.ORE then
105 self:AddDoubleLine("Cost to Prospect: " .. ProspectMe.FormatPrice(ctp), " Average Return: " .. ProspectMe.FormatPrice(lifetimeReturn))
106 elseif subclass == ProspectMe.Vars.HERB then
107 self:AddDoubleLine("Cost to Mill: " .. ProspectMe.FormatPrice(ctp), " Average Return: " .. ProspectMe.FormatPrice(lifetimeReturn))
108 else
109 self:AddDoubleLine("Cost to Process: " .. ProspectMe.FormatPrice(ctp), " Average Return: " .. ProspectMe.FormatPrice(lifetimeReturn))
110 end
111 self:AddLine(" ")
112 local profit = lifetimeReturn - ctp 119 local profit = lifetimeReturn - ctp
113 local margin = (lifetimeReturn / ctp * 100) - 100 120 local margin = (lifetimeReturn / ctp * 100) - 100
114 if margin > 30 then 121 self:AddDoubleLine("Estimated Profit: " .. ProspectMe.FormatPrice(profit), "Cost to " .. spelltext .. ": " .. ProspectMe.FormatPrice(ctp),1,1,1,1,1,1)
115 self:AddLine("Estimated Profit: " .. ProspectMe.FormatPrice(profit) .. "\nMargin: |cff00ff00" .. string.format("[%.1f%%]", margin)) 122 if margin < 30 then
116 elseif margin > 15 then 123 color = "|cffffff00"
117 self:AddLine("Estimated Profit: " .. ProspectMe.FormatPrice(profit) .. "\nMargin: |cffffff00" .. string.format("[%.1f%%]", margin)) 124 elseif margin < 15 then
118 elseif margin > 0 then 125 color = "|cffff0000"
119 self:AddLine("Estimated Profit: " .. ProspectMe.FormatPrice(profit) .. "\nMargin: |cffff0000" .. string.format("[%.1f%%]", margin))
120 else 126 else
121 self:AddLine("No profit to be made",1,0,0) 127 color = "|cff00ff00"
122 end 128 end
129 self:AddDoubleLine("Margin: " .. color .. string.format("[%.1f%%]", margin), "Average Return: " .. ProspectMe.FormatPrice(lifetimeReturn),1,1,1,1,1,1)
123 self:AddLine(" ") 130 self:AddLine(" ")
131
132 -- Results Text Block
124 local t 133 local t
125 if IsAltKeyDown() == ProspectMe.Config.PerSession then 134 if IsAltKeyDown() == ProspectMe.Config.PerSession then
126 t = ProspectMe.Results 135 t = ProspectMe.Results
127 self:AddDoubleLine("Lifetime Results","Hold/Release Alt to toggle",0.5,0.5,1,0.5,0.5,0.5) 136 self:AddDoubleLine("Lifetime Results","Hold Alt to display",1,0.82,0,0.5,0.5,0.5)
128 else 137 else
129 t = ProspectMe.Session 138 t = ProspectMe.Session
130 self:AddDoubleLine("Session Results","Hold/Release Alt to toggle",0.5,0.5,1,0.5,0.5,0.5) 139 self:AddDoubleLine("Session Results","Hold Alt to display",1,0.82,0,0.5,0.5,0.5)
131 end 140 end
132 if t[item] then 141 if t[item] then
133 for q = 7, 0, -1 do 142 for q = 7, 0, -1 do
134 for result, num in pairs(t[item]) do 143 for result, num in pairs(t[item]) do
135 if result ~= "TimesProspected" and select(3, GetItemInfo(result)) == q and ProspectMe.Config.ShowQualities[Quality[q]] then 144 if result ~= "TimesProspected" and select(3, GetItemInfo(result)) == q and ProspectMe.Config.ShowQualities[Quality[q]] then
143 end 152 end
144 else 153 else
145 p = "" 154 p = ""
146 end 155 end
147 if ProspectMe.Config.ShowNumber then 156 if ProspectMe.Config.ShowNumber then
148 n = "[" .. num .. "]" 157 n = "|cffffffffx" .. num
149 else 158 else
150 n = "" 159 n = ""
151 end 160 end
152 self:AddDoubleLine(p .. select(2, GetItemInfo(result)) .. n, ProspectMe.FormatPrice(ProspectMe.GetItemValue(result))) 161 self:AddDoubleLine(p .. select(2, GetItemInfo(result)) .. n, ProspectMe.FormatPrice(ProspectMe.GetItemValue(result)))
153 end 162 end