Mercurial > wow > prospect-me
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 59:ef591210a1e4 | 60:155fa49865f2 |
|---|---|
| 1 local function Initialize () | |
| 2 ProspectMe.GetItemValue = function (itemID) | |
| 3 local v = nil | |
| 4 | |
| 5 if GetAuctionBuyout then -- if an installed addon supports Tekkub's GetAuctionBuyout API: Auctionator, AuctionLite, etc... | |
| 6 v = GetAuctionBuyout(itemID) | |
| 7 elseif AucAdvanced then -- Auctioneer Support | |
| 8 v = AucAdvanced.API.GetMarketValue(PM_ItemTable[itemID].link) | |
| 9 end | |
| 10 | |
| 11 if v == nil then -- provides a failsafe if Auctioneer, etc is set to Load on Demand | |
| 12 v = select(11, GetItemInfo(itemID)) | |
| 13 end | |
| 14 | |
| 15 if v == nil then -- provides a final failsafe - if we can't find anything, set it to 0 (TY peterwemm!) | |
| 16 v = 0.0 | |
| 17 end | |
| 18 | |
| 19 return tonumber(v) | |
| 20 end | |
| 21 end | |
| 22 | |
| 23 local frame = CreateFrame("FRAME", "ProspectMe_Value") | |
| 24 frame:RegisterEvent("VARIABLES_LOADED") | |
| 25 --frame:SetScript("OnEvent", EventHandler) | |
| 26 frame:SetScript("OnEvent", Initialize) |
