Forum Discussion

ForestNinja0's avatar
9 years ago

Need Field List and Attribute Functions

           
  • You want to be able to set the text and title to hard-coded strings? If so, you can set them to:

    text=lambda **_: LocalizationHelperTuning.get_raw_text("Hello!")


    You can find an example of triggering UI dialogs from code in ui_commands.py (ui_dialog_notification_test)
  • "Forest_Ninja;15029666" wrote:
    "SimGuruEugi;15017871" wrote:
    You want to be able to set the text and title to hard-coded strings? If so, you can set them to:

    text=lambda **_: LocalizationHelperTuning.get_raw_text("Hello!")


    You can find an example of triggering UI dialogs from code in ui_commands.py (ui_dialog_notification_test)


    Is there any way to get an instance of TunableLocalizedString by hash?


    Use
    _create_localized_string(string_id, *tokens)
  • No. If you have a reference to a tunable, you can use the reference. If all you have is a hash, you have to create the string. You can't find a tunable using just the hash.