Quantcast currencyType and currencyChangeReason Lookups - ESOUI
Thread Tools Display Modes
04/17/19, 01:33 PM   #1
Vaddi
Join Date: Jun 2016
Posts: 4
Post 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.
  Reply With Quote
04/17/19, 01:45 PM   #2
Shinni
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 134
Probably this one:

GetCurrencyName(number CurrencyType currencyType, boolean isSingular, boolean isLower)
https://wiki.esoui.com/API
  Reply With Quote
04/17/19, 02:27 PM   #3
Vaddi
Join Date: Jun 2016
Posts: 4
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.
  Reply With Quote
04/17/19, 05:07 PM   #4
Baertram
 
Baertram's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 2,122
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.
  Reply With Quote
04/17/19, 09:17 PM   #5
Vaddi
Join Date: Jun 2016
Posts: 4
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
  Reply With Quote
04/18/19, 08:23 AM   #6
Baertram
 
Baertram's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 2,122
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.
  Reply With Quote
04/18/19, 10:34 AM   #7
Vaddi
Join Date: Jun 2016
Posts: 4
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...
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » currencyType and currencyChangeReason Lookups

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off