mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-16 08:52:40 +01:00
Codechange: Use GetString() with argument parameters in simple cases. (#13551)
Avoids using global string parameters.
This commit is contained in:
@@ -170,13 +170,11 @@ void BuildGuiGroupList(GUIGroupList &dst, bool fold, Owner owner, VehicleType ve
|
||||
|
||||
list.Sort([&last_group](const GUIGroupListItem &a, const GUIGroupListItem &b) -> bool {
|
||||
if (a.group != last_group[0].first) {
|
||||
SetDParam(0, a.group->index);
|
||||
last_group[0] = {a.group, GetString(STR_GROUP_NAME)};
|
||||
last_group[0] = {a.group, GetString(STR_GROUP_NAME, a.group->index)};
|
||||
}
|
||||
|
||||
if (b.group != last_group[1].first) {
|
||||
SetDParam(0, b.group->index);
|
||||
last_group[1] = {b.group, GetString(STR_GROUP_NAME)};
|
||||
last_group[1] = {b.group, GetString(STR_GROUP_NAME, b.group->index)};
|
||||
}
|
||||
|
||||
int r = StrNaturalCompare(last_group[0].second, last_group[1].second); // Sort by name (natural sorting).
|
||||
|
||||
Reference in New Issue
Block a user