Add a set of temporary std::strings which can be referenced by StringID

pull/407/head
Jonathan G Rennison 2 years ago
parent 4747e1d1d0
commit ae47b1636a

@ -57,6 +57,8 @@ static uint64 _global_string_params_data[20]; ///< Global array of string pa
static WChar _global_string_params_type[20]; ///< Type of parameters stored in #_global_string_params
StringParameters _global_string_params(_global_string_params_data, 20, _global_string_params_type);
std::string _temp_special_strings[16];
/** Reset the type array. */
void StringParameters::ClearTypeInformation()
{
@ -240,6 +242,9 @@ char *GetStringWithArgs(char *buffr, StringID string, StringParameters *args, co
if (index >= 0xE4 && !game_script) {
return GetSpecialNameString(buffr, index - 0xE4, args, last);
}
if (index < lengthof(_temp_special_strings) && !game_script) {
return FormatString(buffr, _temp_special_strings[index].c_str(), args, last, case_index);
}
break;
case TEXT_TAB_OLD_CUSTOM:

@ -51,6 +51,8 @@ static const uint TAB_SIZE_GAMESCRIPT = TAB_SIZE * 32;
/** Number of strings for NewGRFs */
static const uint TAB_SIZE_NEWGRF = TAB_SIZE * 256;
extern std::string _temp_special_strings[16];
/** Special string constants */
enum SpecialStrings {
@ -86,6 +88,8 @@ enum SpecialStrings {
SPECSTR_SILLY_NAME = 0x70E5,
SPECSTR_ANDCO_NAME = 0x70E6,
SPECSTR_PRESIDENT_NAME = 0x70E7,
SPECSTR_TEMP_START = 0x7000,
};
#endif /* STRINGS_TYPE_H */

Loading…
Cancel
Save