Skip to content

Commit

Permalink
Docs: wagon count tooltip in trains.html to show split of 'real' and …
Browse files Browse the repository at this point in the history
…'randomised' wagons
  • Loading branch information
andythenorth committed Oct 7, 2024
1 parent d5894af commit 25b65b3
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 14 deletions.
10 changes: 10 additions & 0 deletions src/doc_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,16 @@ def not_really_engine_consists(self, roster):
result.append(consist)
return result

def not_really_wagon_consists(self, roster):
# some wagons aren't really wagons
# - randomised wagons, which just compose a set of choices from other wagons
result = []
for consist in roster.wagon_consists:
# this is JFDI reuse of existing attributes, if this gets flakey add a dedicated attribute for exclusion
if getattr(consist.gestalt_graphics, "random_vehicle_map_type", None):
result.append(consist)
return result

def get_role_child_branches_in_order(self, role_child_branches):
# adjust the sort so that it's +ve, -ve for each value, e.g. [1, -1, 2, -2, 3, -3, 4, 5] etc
# this gives the nicest order of related rows in tech tree, assuming that similar engines are in child_branch 1 and child_branch -1
Expand Down
5 changes: 4 additions & 1 deletion src/docs_templates/trains.pt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
<span title="${len(roster.engine_consists_excluding_clones) - len(doc_helper.not_really_engine_consists(roster))} engines and ${len(doc_helper.not_really_engine_consists(roster))} snowploughs, cab cars, metro trains and similar.">
${len(roster.engine_consists_excluding_clones)} engines
</span>
and ${len(roster.wagon_consists)} wagons
and
<span title="${len(roster.wagon_consists) - len(doc_helper.not_really_wagon_consists(roster))} real wagons and ${len(doc_helper.not_really_wagon_consists(roster))} randomised wagons similar.">
${len(roster.wagon_consists)} wagons
</span>
inspired by trains (mostly) from
<span tal:condition="roster.id == 'zebra'">Southern and Western Africa</span>
<span tal:condition="roster.id == 'pony'">the UK and Ireland</span>
Expand Down
Binary file modified src/graphics/pony/lime_covered_hopper_car_type_2_pony_gen_5A.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/graphics/pony/lime_covered_hopper_car_type_2_pony_gen_5B.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/graphics/pony/lime_covered_hopper_car_type_2_pony_gen_5C.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/graphics/pony/lime_covered_hopper_car_type_3_pony_gen_4A.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/graphics/pony/lime_covered_hopper_car_type_3_pony_gen_4B.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/graphics/pony/lime_covered_hopper_car_type_3_pony_gen_5B.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/graphics/pony/lime_covered_hopper_car_type_3_pony_gen_5C.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions src/vehicles/pony/lime_covered_hopper_cars_type_2_pony.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,37 +25,37 @@ def main(roster_id, **kwargs):
)

consist.add_unit(type=FreightCar, chassis="2_axle_gapped_24px")
"""

consist = MineralCoveredHopperCarLimeConsistType2(
roster_id=roster_id,
roster_id_providing_module=kwargs["roster_id_providing_module"],
base_numeric_id=24920,
gen=5,
subtype="A",
sprites_complete=False,
sprites_complete=True,
)

consist.add_unit(type=FreightCar, chassis="2_axle_gapped_greebled_16px")
consist.add_unit(type=FreightCar, chassis="2_axle_chute_greebled_16px")

consist = MineralCoveredHopperCarLimeConsistType2(
roster_id=roster_id,
roster_id_providing_module=kwargs["roster_id_providing_module"],
base_numeric_id=24930,
gen=5,
subtype="B",
sprites_complete=False,
sprites_complete=True,
)

consist.add_unit(type=FreightCar, chassis="2_axle_filled_greebled_24px")
consist.add_unit(type=FreightCar, chassis="2_axle_chute_greebled_24px")

consist = MineralCoveredHopperCarLimeConsistType2(
roster_id=roster_id,
roster_id_providing_module=kwargs["roster_id_providing_module"],
base_numeric_id=22250,
gen=5,
subtype="C",
sprites_complete=False,
sprites_complete=True,
)

consist.add_unit(type=FreightCar, chassis="4_axle_chute_greebled_alt_32px")
"""

12 changes: 6 additions & 6 deletions src/vehicles/pony/lime_covered_hopper_cars_type_3_pony.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

def main(roster_id, **kwargs):
# --------------- standard gauge ---------------------------------------------------------------
"""

consist = MineralCoveredHopperCarLimeConsistType3(
roster_id=roster_id,
roster_id_providing_module=kwargs["roster_id_providing_module"],
base_numeric_id=34840,
gen=4,
subtype="A",
sprites_complete=False,
sprites_complete=True,
)

consist.add_unit(type=FreightCar, chassis="2_axle_gapped_16px")
Expand All @@ -21,11 +21,11 @@ def main(roster_id, **kwargs):
base_numeric_id=33820,
gen=4,
subtype="B",
sprites_complete=False,
sprites_complete=True,
)

consist.add_unit(type=FreightCar, chassis="2_axle_gapped_24px")
"""

consist = MineralCoveredHopperCarLimeConsistType3(
roster_id=roster_id,
roster_id_providing_module=kwargs["roster_id_providing_module"],
Expand All @@ -35,7 +35,7 @@ def main(roster_id, **kwargs):
sprites_complete=True,
)

consist.add_unit(type=FreightCar, chassis="2_axle_gapped_greebled_16px")
consist.add_unit(type=FreightCar, chassis="2_axle_chute_greebled_16px")

consist = MineralCoveredHopperCarLimeConsistType3(
roster_id=roster_id,
Expand All @@ -46,7 +46,7 @@ def main(roster_id, **kwargs):
sprites_complete=True,
)

consist.add_unit(type=FreightCar, chassis="2_axle_filled_greebled_24px")
consist.add_unit(type=FreightCar, chassis="2_axle_chute_greebled_24px")

consist = MineralCoveredHopperCarLimeConsistType3(
roster_id=roster_id,
Expand Down

0 comments on commit 25b65b3

Please sign in to comment.