From 9c71780ec4eab7cc0d097bc6b0ead10bd2688043 Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 11 Aug 2024 23:44:43 +0100 Subject: [PATCH] Moved some parameter switches to the end of the NML file to ensure vehicles are disabled correctly --- build.py | 13 +++++++++++-- src/{ => append}/debugmode_switch.pnml | 8 ++++---- src/{ => append}/metroparam_switch.pnml | 0 src/{ => append}/simplemode_switch.pnml | 0 4 files changed, 15 insertions(+), 6 deletions(-) rename src/{ => append}/debugmode_switch.pnml (75%) rename src/{ => append}/metroparam_switch.pnml (100%) rename src/{ => append}/simplemode_switch.pnml (100%) diff --git a/build.py b/build.py index 65ff8284..4752299e 100644 --- a/build.py +++ b/build.py @@ -267,20 +267,29 @@ def main(grf_name, src_dir, lang_dir, gfx_dir, b_compile_grf, b_run_game): file_list = find_pnml_files(src_directory) print("Finished finding pnml files\n") pnml_files = list() - # Read all the files in folders that begin with "_" into the internal nml + append_files = list() + # Priority folders: Read all the files in folders that begin with "_" into the internal nml for directory in file_list: if directory.startswith("_"): for file in file_list[directory]: print("Reading '%s'" % (file.stem + file.suffix)) nml_file = copy_file(file, nml_file) else: - pnml_files += file_list[directory] + if directory == "append": + append_files += file_list[directory] + else: + pnml_files += file_list[directory] # Read the regular files for file in sorted(pnml_files): print("Reading '%s'" % (file.stem + file.suffix)) nml_file = copy_file(file, nml_file) + # Read the append files (mostly switches to disable units) + for file in sorted(append_files): + print("Reading '%s'" % (file.stem + file.suffix)) + nml_file = copy_file(file, nml_file) + print("Copied all files to internal buffer\n") # Try to write the internal nml to a file diff --git a/src/debugmode_switch.pnml b/src/append/debugmode_switch.pnml similarity index 75% rename from src/debugmode_switch.pnml rename to src/append/debugmode_switch.pnml index 98fb77cc..f36f4540 100644 --- a/src/debugmode_switch.pnml +++ b/src/append/debugmode_switch.pnml @@ -6,6 +6,9 @@ disable_item(FEAT_TRAINS, 674); // Stephenson's Planet // Disable some trains that only exist for template alignment or debugging + disable_item(FEAT_TRAINS, 9999); // Debug variant header + disable_item(FEAT_TRAINS, 609); // 4px + disable_item(FEAT_TRAINS, 610); // 8px disable_item(FEAT_TRAINS, 601); // 12px disable_item(FEAT_TRAINS, 602); // 16px disable_item(FEAT_TRAINS, 603); // 20px @@ -13,8 +16,5 @@ disable_item(FEAT_TRAINS, 605); // 28px disable_item(FEAT_TRAINS, 606); // 32px disable_item(FEAT_TRAINS, 607); // 28pxOLD - disable_item(FEAT_TRAINS, 608); // 32pxOLD - - - + disable_item(FEAT_TRAINS, 608); // 32pxOLD } \ No newline at end of file diff --git a/src/metroparam_switch.pnml b/src/append/metroparam_switch.pnml similarity index 100% rename from src/metroparam_switch.pnml rename to src/append/metroparam_switch.pnml diff --git a/src/simplemode_switch.pnml b/src/append/simplemode_switch.pnml similarity index 100% rename from src/simplemode_switch.pnml rename to src/append/simplemode_switch.pnml