OpenTTD Source  1.11.2
game_text.hpp File Reference

Go to the source code of this file.

Data Structures

struct  LanguageStrings
 Container for the raw (unencoded) language strings of a language. More...
 
struct  GameStrings
 Container for all the game strings. More...
 

Functions

const char * GetGameStringPtr (uint id)
 Get the string pointer of a particular game string. More...
 
void RegisterGameTranslation (class Squirrel *engine)
 Register the current translation to the Squirrel engine. More...
 
void ReconsiderGameScriptLanguage ()
 Reconsider the game script language, so we use the right one.
 

Detailed Description

Base functions regarding game texts.

Definition in file game_text.hpp.

Function Documentation

◆ GetGameStringPtr()

const char* GetGameStringPtr ( uint  id)

Get the string pointer of a particular game string.

Parameters
idThe ID of the game string.
Returns
The encoded string.

Definition at line 309 of file game_text.cpp.

References _current_data, GameStrings::cur_language, and LanguageStrings::lines.

◆ RegisterGameTranslation()

void RegisterGameTranslation ( Squirrel engine)

Register the current translation to the Squirrel engine.

Parameters
engineThe engine to update/

Definition at line 319 of file game_text.cpp.

References _current_data, Squirrel::GetVM(), LoadTranslations(), ReconsiderGameScriptLanguage(), and GameStrings::string_names.

Referenced by GameInstance::RegisterAPI().