GetCurrencyInfo
http://wowprogramming.com/docs/api/GetCurrencyInfo
According to wowprogramming.com, it returns: name, amount, texture, earnedThisWeek, weeklyMax, totalMax, isDiscovered lua Code:
I tried using totalMax in this, but it wasn't working. Using 4000 works fine, obviously, but I don't really understand the point of having "totalMax" if it doesn't return anything? Or maybe, I wasn't going about it the right way? |
lua Code:
|
>_<
http://www.youtube.com/watch?v=wOKK8mAkiUI edit: Welll, no, it still doesn't work quite right. Code:
/script function CurrencyText() local name, currentAmount,_,_,_,totalMax = GetCurrencyInfo(396) return string.format("%0.0f%% | %s / %s", (currentAmount/totalMax)*100, currentAmount, totalMax); end currencytext = CurrencyText(); print(currencytext) |
It does indeed seem that the maximum values are incorrect as returned by that function (or perhaps just returned multiplied by 100 for some reason). I checked some other UI functions like GetCurrencyListInfo and they also return values inflated by 100 times. Unfortunately I think JP and Honor are the only currencies left in the game with hard caps so it's hard to tell if there is a trend going on here.
I checked Blizzard's UI code to see how they do it, and it seems like the answer is that they don't either. No Lua/XML of Blizzard's uses the max value returned by these functions. In fact, the only time the max value appears is on a tooltip when GameTooltip:SetCurrencyToken is called--a hard-coded function. That tooltip also provides info like "Season Total Earned" which is not provided by any Lua-accessible function. |
All times are GMT -6. The time now is 08:26 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI