diff Modules/ProspectMe_Value.lua @ 60:155fa49865f2 v2.7.1.2-Alpha

Changed directory structure around to clean it up a bit.
author Vynn <mischivin@gmail.com>
date Mon, 28 Nov 2016 12:28:35 -0500
parents ProspectMe_Value.lua@5cbaaee1e7db
children 17897a788554
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Modules/ProspectMe_Value.lua	Mon Nov 28 12:28:35 2016 -0500
@@ -0,0 +1,26 @@
+local function Initialize ()
+	ProspectMe.GetItemValue = function (itemID)
+		local v = nil
+		
+		if GetAuctionBuyout then -- if an installed addon supports Tekkub's GetAuctionBuyout API: Auctionator, AuctionLite, etc...
+			v = GetAuctionBuyout(itemID)
+		elseif AucAdvanced then -- Auctioneer Support
+			v = AucAdvanced.API.GetMarketValue(PM_ItemTable[itemID].link)
+		end
+		
+		if v == nil then -- provides a failsafe if Auctioneer, etc is set to Load on Demand
+			v = select(11, GetItemInfo(itemID))
+		end
+		
+		if v == nil then -- provides a final failsafe - if we can't find anything, set it to 0 (TY peterwemm!)
+			v = 0.0
+		end
+
+		return tonumber(v)
+	end
+end
+
+local frame = CreateFrame("FRAME", "ProspectMe_Value")
+frame:RegisterEvent("VARIABLES_LOADED")
+--frame:SetScript("OnEvent", EventHandler)
+frame:SetScript("OnEvent", Initialize)
\ No newline at end of file