ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   currencyType and currencyChangeReason Lookups (https://www.esoui.com/forums/showthread.php?t=8469)

Vaddi 04/17/19 01:33 PM

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.

Shinni 04/17/19 01:45 PM

Probably this one:

GetCurrencyName(number CurrencyType currencyType, boolean isSingular, boolean isLower)
https://wiki.esoui.com/API

Vaddi 04/17/19 02:27 PM

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.

Baertram 04/17/19 05:07 PM

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.

Vaddi 04/17/19 09:17 PM

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 :(

Baertram 04/18/19 08:23 AM

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.

Vaddi 04/18/19 10:34 AM

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