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:
@@ -60,10 +60,10 @@ void DrawRoadVehDetails(const Vehicle *v, const Rect &r)
|
||||
|
||||
SetDParam(0, cid);
|
||||
SetDParam(1, max_cargo[cid]);
|
||||
capacity += GetString(STR_JUST_CARGO);
|
||||
AppendStringInPlace(capacity, STR_JUST_CARGO);
|
||||
|
||||
if (subtype_text[cid] != STR_NULL) {
|
||||
capacity += GetString(subtype_text[cid]);
|
||||
AppendStringInPlace(capacity, subtype_text[cid]);
|
||||
}
|
||||
|
||||
first = false;
|
||||
|
||||
Reference in New Issue
Block a user