1
0
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:
Peter Nelson
2025-02-14 00:10:56 +00:00
committed by GitHub
parent c3d5e6d2a0
commit 20e57a02a2
26 changed files with 79 additions and 170 deletions

View File

@@ -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).