currencyType and currencyChangeReason Lookups
Is there a function to convert currencyType to an appropriate string? For example; when currencyType is 9 the currency is an Event Ticket. There is a constant named CURT_EVENT_TICKETS that has a value of 9. However; I haven't found a way to get from 9 to "Event Ticket" other than writing my own lookup table. I was hoping to find something like GetString(SI_CURTNAME, currencyType). Does something like that exist and I have just failed to find it?
I have the same question for currencyChangeReason. I find about 75 constants for that (like CURRENCY_CHANGE_REASON_QUESTREWARD); but again I don't see a way to get from the number to the name. Thanks for any help. |
Probably this one:
GetCurrencyName(number CurrencyType currencyType, boolean isSingular, boolean isLower) https://wiki.esoui.com/API |
DOH! How did I miss that function?
Thank you Shinni; that works great :) I'm still looking for a way to get currencyChangeReason as text. |
The values for the curr change reason can be found here:
https://wiki.esoui.com/Globals#CurrencyChangeReason If I watch the reasons there I think off them only as constant values but NO text. I guess there is no text. Or you could look if you find something here: https://github.com/esoui/esoui/tree/...melocalization https://github.com/esoui/esoui/tree/...melocalization Check the lua files for SI_* constants which might match the reasons. You can get the string by using function GetString(SI*) constant then. |
Thanks Baertram. I was hoping there was a GetString() function for this; but I've had no luck finding it. I have been looking at the wiki pages. These github pages will be a good resource too. I haven't found anything that looks like what I need.
I pulled the CURRENCY_CHANGE_REASON constants into a spreadsheet and wrote a couple of formulas to convert those names into LUA code. I think I'm stuck with an internal table :( |
Think about multi language Support from the beginning! It's easier than having to rebuild Code later on. Check the Wiki for localization e.g.
|
This thing is fully localized. I used the spreadsheet to generate the 76 ZO_CreateStringId statements for my language file and then also generate a table that consisted of the corresponding GetString() statements. So I have 152 lines of code to do what I hoped could be done with 1 line. Oh well...
|
All times are GMT -6. The time now is 09:08 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI