Jump to content

How To Replace Hardcoded Strings


Recommended Posts

  • Bot

Hi devs,
I think a lot of you are not satisfied with an arrangement of client in default. Well, it is a long way to make it by your conception however I think this might help you a bit. There are a few hardcoded strings that could make a problem for you when creating a binary for more than one language. Here is a simple solution of how can you call those strings from a resource file.

Go to the UserInterface > Resource Files and open UserInterface.rs. In Resource View unwrap String Table section and double click on String Table string node. Here you have a simple table with ID, value and caption. Lemme clarify this a bit.

ID - An identifier you will use to call a required string.
Value - A number that editor use for ordering the strings.
Caption - Desired content of a string.

To add a new string just click under the last string and fill all the columns. When you are done, save your new string by pressing an Enter key.

To call our string use ApplicationStringTable_GetStringz(+two overloads) function.

Here is a little example of usage:
Old version:

void __ErrorPythonLibraryIsNotExist()
{
      LogBoxf("Oh crap! Python libraries are gone.");
}

 

New version:

void __ErrorPythonLibraryIsNotExist()
{
	LogBoxf(ApplicationStringTable_GetStringz(/*ID of your string.*/));
}

 

Sources:

  • Love 6

english_banner.gif

Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.