Skip to content

Commit

Permalink
Change: use pluralised group names for wagons that have variants, eve…
Browse files Browse the repository at this point in the history
…n if a named buyable variant group isn't configured
  • Loading branch information
andythenorth committed May 18, 2024
1 parent 3ebb793 commit e586fb8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
28 changes: 28 additions & 0 deletions src/lang/english.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plural = 0
[STR_GRF_DESCRIPTION]
base = "License: {SILVER}GPL v2{}{BLACK}"


# parameters (action 14 etc)

[STR_PARAM_VEHICLE_AVAILABILITY_ENGINES]
Expand Down Expand Up @@ -273,9 +274,15 @@ base = "Box Vans"
[STR_WAGON_GROUP_BULKHEAD_FLAT_CARS]
base = "Bulkhead Flat Wagons"

[STR_WAGON_GROUP_DOUBLE_DECK_AUTOMOBILE_CARS]
base = "Car Transporters"

[STR_WAGON_GROUP_CEMENT_SILO_CARS]
base = "Cement Wagons"

[STR_WAGON_GROUP_CHEMICAL_COVERED_HOPPER_CARS]
base = "Chemical Covered Hoppers"

[STR_WAGON_GROUP_COIL_BUGGY_CARS]
base = "Coil Buggies"

Expand All @@ -300,6 +307,18 @@ base = "Farm Product Wagons"
[STR_WAGON_GROUP_FLAT_CARS]
base = "Flat Wagons"

[STR_WAGON_GROUP_HEAVY_DUTY_DUMP_CARS]
base = "Heavy Duty Bulk Wagons"

[STR_WAGON_GROUP_HEAVY_DUTY_FLAT_CARS]
base = "Heavy Duty Flat Wagons"

[STR_WAGON_GROUP_HIGH_SPEED_MAIL_CARS]
base = "High Speed Mail Vans"

[STR_WAGON_GROUP_HIGH_SPEED_PASSENGER_CARS]
base = "High Speed Coaches"

[STR_WAGON_GROUP_HOPPER_CARS]
base = "Hoppers"

Expand All @@ -325,6 +344,9 @@ base = "MGR Hoppers"
[STR_WAGON_GROUP_OPEN_CARS]
base = "Open Wagons"

[STR_WAGON_GROUP_PANORAMIC_CARS]
base = "Panoramic Coaches"

[STR_WAGON_GROUP_PASSENGER_CARS]
base = "Passenger Coaches"

Expand Down Expand Up @@ -380,6 +402,9 @@ base = "Rock Hoppers"
[STR_WAGON_GROUP_ROLLER_ROOF_HOPPER_CARS]
base = "Roller Roof Hoppers"

[STR_WAGON_GROUP_SCRAP_METAL_CARS]
base = "Scrap Wagons"

[STR_WAGON_GROUP_SILO_CARS]
base = "Silo Wagons"

Expand All @@ -389,6 +414,9 @@ base = "Skips"
[STR_WAGON_GROUP_SLAG_LADLE_CARS]
base = "Slag Ladle Wagon"

[STR_WAGON_GROUP_SLIDING_ROOF_HI_CUBE_CARS]
base = "Cube Wagons"

[STR_WAGON_GROUP_SLIDING_WALL_CARS]
base = "Sliding Wall Vans"

Expand Down
7 changes: 6 additions & 1 deletion src/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -2493,7 +2493,12 @@ def get_name_parts(self, context, unit_variant):
except:
raise BaseException(group.parent_vehicle.id)
else:
result = default_result
# some dubious special-casing to make wagon names plural if there are variants, and a named variant group is *not* already used
if len(group.buyable_variants) > 1:
result = default_result.copy()
result[0] = result[0].replace("STR_NAME_SUFFIX_", "STR_WAGON_GROUP_") + "S"
else:
result = default_result
elif context == "purchase_level_1":
# if a level 1 group has a parent, then it is also the parent of a group of level 2 vehicles
if (
Expand Down

0 comments on commit e586fb8

Please sign in to comment.