mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-14 10:09:11 +00:00
Add: AppendStringInPlace() to append translated string ID into an existing string. (#12969)
This allows avoiding a string copy when building strings.
This commit is contained in:
@@ -394,11 +394,11 @@ void ShowErrorMessage(StringID summary_msg, StringID detailed_msg, WarningLevel
|
||||
std::string message = GetString(summary_msg);
|
||||
if (detailed_msg != INVALID_STRING_ID) {
|
||||
message += " ";
|
||||
message += GetString(detailed_msg);
|
||||
AppendStringInPlace(message, detailed_msg);
|
||||
}
|
||||
if (extra_msg != INVALID_STRING_ID) {
|
||||
message += " ";
|
||||
message += GetString(extra_msg);
|
||||
AppendStringInPlace(message, extra_msg);
|
||||
}
|
||||
|
||||
if (textref_stack_size > 0) StopTextRefStackUsage();
|
||||
|
Reference in New Issue
Block a user