View Single Post
02/02/22, 05:58 PM   #5
Gullyable
Join Date: Apr 2018
Posts: 13
The docs don't specify the def values so I'm just assuming they always start at zero and go up sequentially.

Originally Posted by Baertram View Post
Just as a heads-up:

You could even strip the [number] indices at the table in lua if the values are non-gap numbers 1, 2, 3, 4, 5, ... n
Lua Code:
  1. local CURRENCY_CHANGE_REASON_STRINGS = {
  2.    "CURRENCY_CHANGE_REASON_ABILITY_UPGRADE_PURCHASE",
  3.    "CURRENCY_CHANGE_REASON_ACHIEVEMENT",
  4.     -- all the other values
  5.    "CURRENCY_CHANGE_REASON_VENDOR_REPAIR",
  6. }
If there is a gap though you need the number as else it will just always increase by 1 autoamtically and get out of sync with the real values of the constants!

I guess, as you generate the entries via python code you will just always create the indices
  Reply With Quote