Add: Show all railtypes in the build vehicle and engine preview dialogs.

This commit is contained in:
Michael Lutz
2025-09-08 00:25:17 +02:00
committed by dP
parent ceee8016a5
commit d2d7184492
3 changed files with 29 additions and 0 deletions
+13
View File
@@ -632,6 +632,19 @@ static int DrawRailEnginePurchaseInfo(int left, int right, int y, EngineID engin
}
y += GetCharacterHeight(FS_NORMAL);
/* Supported rail types */
std::string railtypes{};
std::string_view list_separator = GetListSeparator();
for (const auto &rt : _sorted_railtypes) {
if (!rvi->railtypes.Test(rt)) continue;
if (!railtypes.empty()) railtypes += list_separator;
AppendStringInPlace(railtypes, GetRailTypeInfo(rt)->strings.name);
}
DrawString(left, right, y, GetString(STR_PURCHASE_INFO_RAILTYPES, railtypes));
y += GetCharacterHeight(FS_NORMAL);
/* Max speed - Engine power */
DrawString(left, right, y, GetString(STR_PURCHASE_INFO_SPEED_POWER, PackVelocity(e->GetDisplayMaxSpeed(), e->type), e->GetPower()));
y += GetCharacterHeight(FS_NORMAL);