Change: [Script] Improve ScriptText validation error messages

This commit is contained in:
glx22
2023-03-05 17:00:16 +01:00
committed by Loïc Guilloux
parent 8fa61533f0
commit 9a957f1d4b
3 changed files with 23 additions and 7 deletions

View File

@@ -354,6 +354,20 @@ const StringParams &GetGameStringParams(uint id)
return _current_data->string_params[id];
}
/**
* Get the name of a particular game string.
* @param id The ID of the game string.
* @return The name of the string.
*/
const std::string &GetGameStringName(uint id)
{
/* The name for STR_UNDEFINED. */
static const std::string undefined = "STR_UNDEFINED";
if (id >= _current_data->string_names.size()) return undefined;
return _current_data->string_names[id];
}
/**
* Register the current translation to the Squirrel engine.
* @param engine The engine to update/