# HG changeset patch # User Tercioo # Date 1452728072 7200 # Node ID 216d8b3d039c5272c812fb65827266044c571812 # Parent b49854df36fc021cb03f0cce3425bf763d37aadb - small bug fixes. diff -r b49854df36fc -r 216d8b3d039c GoldPrice.lua --- a/GoldPrice.lua Tue Jun 23 13:56:35 2015 -0300 +++ b/GoldPrice.lua Wed Jan 13 21:34:32 2016 -0200 @@ -1,6 +1,3 @@ - - - do local f = CreateFrame ("frame", "GoldPriceFrame", UIParent) f:RegisterEvent ("TOKEN_MARKET_PRICE_UPDATED") @@ -13,11 +10,12 @@ end f:SetScript ("OnEvent", function (self, event) - - local price = C_WowTokenPublic.GetCurrentMarketPrice() - price = floor (price / 10000) - - print ("|cFFFF9900Token Price|r: ", f:comma_value (price) .. "|TInterface\\MoneyFrame\\UI-GoldIcon:0:0:2:0|t") + if (f.canShow) then + local price = C_WowTokenPublic.GetCurrentMarketPrice() + price = floor (price / 10000) + print ("|cFFFF9900Token Price|r: ", f:comma_value (price) .. "|TInterface\\MoneyFrame\\UI-GoldIcon:0:0:2:0|t") + f.canShow = false + end end) end @@ -25,11 +23,13 @@ function SlashCmdList.GoldPrice (msg, editbox) if (GoldPriceFrame.LastQuerry and GoldPriceFrame.LastQuerry+15 > GetTime()) then local price = C_WowTokenPublic.GetCurrentMarketPrice() - price = floor (price / 10000) - return print ("|cFFFF9900Token Price|r: ", GoldPriceFrame:comma_value (price) .. "|TInterface\\MoneyFrame\\UI-GoldIcon:0:0:2:0|t") + if (price) then + price = floor (price / 10000) + return print ("|cFFFF9900Token Price|r: ", GoldPriceFrame:comma_value (price) .. "|TInterface\\MoneyFrame\\UI-GoldIcon:0:0:2:0|t") + end end + + GoldPriceFrame.canShow = true GoldPriceFrame.LastQuerry = GetTime() C_WowTokenPublic.UpdateMarketPrice() -end - - +end \ No newline at end of file diff -r b49854df36fc -r 216d8b3d039c GoldPrice.toc --- a/GoldPrice.toc Tue Jun 23 13:56:35 2015 -0300 +++ b/GoldPrice.toc Wed Jan 13 21:34:32 2016 -0200 @@ -1,5 +1,5 @@ ## Interface: 60200 -## Title: Gold Token Price +## Title: Lib: TokenCommands-1.0 ## Notes: Adds the slash command /gold /token showing the current token price. GoldPrice.lua \ No newline at end of file