LuaGameplay.wiki
changeset 2260 e9eccb1eeac4
parent 2256 54f89e50129d
child 2262 6dc92adc347a
equal deleted inserted replaced
2259:5a96e2672310 2260:e9eccb1eeac4
   117 Returns a string that is used in the engine in localized form. For example, "Round draw!". Useful to avoid repeating common gameplay-relevant texts in Lua which reduces redundancy.
   117 Returns a string that is used in the engine in localized form. For example, "Round draw!". Useful to avoid repeating common gameplay-relevant texts in Lua which reduces redundancy.
   118 
   118 
   119  * `stringType`: One of:
   119  * `stringType`: One of:
   120   * `"TMsgStrId"` for basic messages (section `01` in `en.txt`) or
   120   * `"TMsgStrId"` for basic messages (section `01` in `en.txt`) or
   121   * `"TGoalStrId"` for strings used to describe game rules in the mission panel (section `05` in `en.txt`) 
   121   * `"TGoalStrId"` for strings used to describe game rules in the mission panel (section `05` in `en.txt`) 
   122  * `msgId`: The corresponding message ID (see https://hg.hedgewars.org/hedgewars/file/tip/hedgewars/uTypes.pas for a list of IDs; look for `TMsgStrId` and `TGoalStrId`)
   122  * `msgId`: The corresponding message ID (see [StringIDs])
   123 
   123 
   124 Example:
   124 Example:
   125 <code language="lua">
   125 <code language="lua">
   126 -- Shows the "round draw" text from the engine, localized to the player's language
   126 -- Shows the "round draw" text from the engine, localized to the player's language
   127 AddCaption(GetEngineString("TMsgStrId", sidDraw), capcolDefault, capgrpGameState)
   127 AddCaption(GetEngineString("TMsgStrId", sidDraw), capcolDefault, capgrpGameState)