comparison ProspectMe_Tooltip.lua @ 54:73a564278360

Fixed a minor issue with margin colorization in the tooltip
author Vynn <mischivin@gmail.com>
date Fri, 18 Nov 2016 15:19:57 -0500
parents a2fc078e4d70
children 60f990099d03
comparison
equal deleted inserted replaced
53:3e925b075e7d 54:73a564278360
117 lifetimeReturn = lifetimeReturn * 4 117 lifetimeReturn = lifetimeReturn * 4
118 end 118 end
119 local profit = lifetimeReturn - ctp 119 local profit = lifetimeReturn - ctp
120 local margin = (lifetimeReturn / ctp * 100) - 100 120 local margin = (lifetimeReturn / ctp * 100) - 100
121 self:AddDoubleLine("Estimated Profit: " .. ProspectMe.FormatPrice(profit), "Cost to " .. spelltext .. ": " .. ProspectMe.FormatPrice(ctp),1,1,1,1,1,1) 121 self:AddDoubleLine("Estimated Profit: " .. ProspectMe.FormatPrice(profit), "Cost to " .. spelltext .. ": " .. ProspectMe.FormatPrice(ctp),1,1,1,1,1,1)
122 if margin < 30 then 122 if margin < 15 then
123 color = "|cffff0000"
124 elseif margin < 30 then
123 color = "|cffffff00" 125 color = "|cffffff00"
124 elseif margin < 15 then
125 color = "|cffff0000"
126 else 126 else
127 color = "|cff00ff00" 127 color = "|cff00ff00"
128 end 128 end
129 self:AddDoubleLine("Margin: " .. color .. string.format("[%.1f%%]", margin), "Average Return: " .. ProspectMe.FormatPrice(lifetimeReturn),1,1,1,1,1,1) 129 self:AddDoubleLine("Margin: " .. color .. string.format("[%.1f%%]", margin), "Average Return: " .. ProspectMe.FormatPrice(lifetimeReturn),1,1,1,1,1,1)
130 self:AddLine(" ") 130 self:AddLine(" ")