changeset 39:b9c2260bf1b4 Prospect Me 2

Updated the tooltips to better reflect mass prospecting/milling cost/return, support tooltips on mouse over of the Mass Prospecting/Milling spells, and general tooltip formatting improvements
author Vynn <mischivin@gmail.com>
date Thu, 10 Nov 2016 16:01:43 -0500
parents 69c7955b75b1
children 97fe62d4385d
files ProspectMe_Tooltip.lua
diffstat 1 files changed, 39 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/ProspectMe_Tooltip.lua	Thu Nov 10 12:26:59 2016 -0500
+++ b/ProspectMe_Tooltip.lua	Thu Nov 10 16:01:43 2016 -0500
@@ -1,5 +1,5 @@
---PM_HERBSUBCLASS = select(6, GetAuctionItemSubClasses(6))
---PM_ORESUBCLASS = select(4, GetAuctionItemSubClasses(6))
+local ORE = select(7,GetItemInfo(123918)) -- Get Ore Subclass from a known quantity (leystone ore)
+local HERB = select(7,GetItemInfo(128304)) -- Get Herb Subclass from a known quantity (yseralline seed)
 
 local Quality = { [0] = "Junk", [1]= "Common", [2] = "Uncommon", [3] = "Rare", [4] = "Epic", }
 
@@ -57,9 +57,23 @@
  
 local function OnTooltipSetItem(self)
 	if cleared then
-		local name, tooltipLink = self:GetItem()
-		if tooltipLink then
-			local item = tonumber(tooltipLink:match("Hitem:(%d+)"))
+		local tooltipLink = select(2, self:GetItem())
+		local spellid = select(3, self:GetSpell())
+		local item = nil
+		if spellid == 225902 then
+			item = 123918
+		elseif spellid == 225904 then
+			item = 123919
+		elseif spellid == 210116 then
+			item = 128304
+		elseif tooltipLink then 
+			item = tonumber(tooltipLink:match("Hitem:(%d+)"))
+			spellid = nil
+		else
+			item = nil
+			spellid = nil
+		end
+		if item then
 			if ProspectMe.Results[item] then
 				local price = ProspectMe.GetItemValue(item)
 				local lifetimeReturn = ProspectMe.GetReturn(item)
@@ -67,9 +81,25 @@
 				self:AddLine(" ")
 				self:AddLine("Prospect Me",0.5,1,0.5)
 				self:AddLine("Times Processed: " .. ProspectMe.Results[item].TimesProspected)
-				self:AddDoubleLine("Cost to Process: " .. ProspectMe.FormatPrice(5 * price), " Average Return: " .. ProspectMe.FormatPrice(lifetimeReturn))
-				if lifetimeReturn-(5 * price) > 0 then
-					self:AddLine("Estimated Profit: " ..ProspectMe.FormatPrice(lifetimeReturn-(5 * price)))
+				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))
+				elseif spellid == 210116 then
+					self:AddDoubleLine("Cost to Mass Mill: " .. ProspectMe.FormatPrice(ctp), " Average Return: " .. ProspectMe.FormatPrice(lifetimeReturn))
+				elseif select(7,GetItemInfo(item)) == ORE then
+					self:AddDoubleLine("Cost to Prospect: " .. ProspectMe.FormatPrice(ctp), " Average Return: " .. ProspectMe.FormatPrice(lifetimeReturn))
+				elseif select(7,GetItemInfo(item)) == HERB then
+					self:AddDoubleLine("Cost to Mill: " .. ProspectMe.FormatPrice(ctp), " Average Return: " .. ProspectMe.FormatPrice(lifetimeReturn))
+				else
+					self:AddDoubleLine("Cost to Process: " .. ProspectMe.FormatPrice(ctp), " Average Return: " .. ProspectMe.FormatPrice(lifetimeReturn))
+				end
+				if lifetimeReturn-(ctp) > 0 then
+					self:AddLine("Estimated Profit: " ..ProspectMe.FormatPrice(lifetimeReturn-(ctp)))
 					self:AddLine(" ")
 				else
 					self:AddLine("No profit to be made",1,0,0)
@@ -107,7 +137,7 @@
 							end
 						end
 					end
-					self:AddLine(" ")
+					--self:AddLine(" ")
 				end
 			end
 			cleared = true