From 249f4400a44c91245096bf253c1eac5978114a74 Mon Sep 17 00:00:00 2001 From: Cornka <112967882+Kocma-san@users.noreply.github.com> Date: Sun, 19 Oct 2025 00:45:29 +0700 Subject: [PATCH] Small QoL for tools/UpdatePaths (#93482) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## About The Pull Request Added the ability to drag and drop multiple files with scripts onto `Update Paths.bat` instead of just one. изображение ## Why It's Good For The Game It is faster and easier to use! ## Changelog Not needed? --- tools/UpdatePaths/__main__.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/UpdatePaths/__main__.py b/tools/UpdatePaths/__main__.py index 477b1f125ae..2715176451c 100644 --- a/tools/UpdatePaths/__main__.py +++ b/tools/UpdatePaths/__main__.py @@ -177,9 +177,12 @@ def main(args): print("Using replacement:", args.update_source) updates = [args.update_source] else: - with open(args.update_source) as f: - updates = [line for line in f if line and not line.startswith("#") and not line.isspace()] - print(f"Using {len(updates)} replacements from file:", args.update_source) + updates = [] + for source in args.update_source: + with open(source) as f: + updates_from_file = [line for line in f if line and not line.startswith("#") and not line.isspace()] + print(f"Using {len(updates_from_file)} replacements from file:", source) + updates.extend(updates_from_file) if args.map: update_map(args.map, updates, verbose=args.verbose) @@ -191,10 +194,10 @@ def main(args): if __name__ == "__main__": prog = __spec__.name.replace('.__main__', '') if os.name == 'nt' and len(sys.argv) <= 1: - print("usage: drag-and-drop a path script .txt onto `Update Paths.bat`\n or") + print("usage: drag-and-drop one or more .txt path script onto `Update Paths.bat`\n or") parser = argparse.ArgumentParser(prog=prog, description=desc, formatter_class=argparse.RawTextHelpFormatter) - parser.add_argument("update_source", help="update file path / line of update notation") + parser.add_argument("update_source", nargs="+", help="update file path(s) / line of update notation") parser.add_argument("--map", "-m", help="path to update, defaults to all maps in maps directory") parser.add_argument("--directory", "-d", help="path to maps directory, defaults to _maps/") parser.add_argument("--inline", "-i", help="treat update source as update string instead of path", action="store_true")