From d791901113a8d3c787a7652ab6a5a1b4ad0d6077 Mon Sep 17 00:00:00 2001 From: mqrause Date: Thu, 19 Dec 2024 22:23:59 +0100 Subject: [PATCH] group mod interactions --- build-scripts/get_all_mods.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/build-scripts/get_all_mods.py b/build-scripts/get_all_mods.py index 6072b78d68031..b9d244f29fdf8 100755 --- a/build-scripts/get_all_mods.py +++ b/build-scripts/get_all_mods.py @@ -7,6 +7,7 @@ import glob import json +import os mods_this_time = [] @@ -62,6 +63,26 @@ def print_modlist(modlist, master_list): if e["category"] == "total_conversion": total_conversions.add(ident) +for r, d, f in os.walk('data/mods'): + if 'mod_interactions' not in d: + continue + if 'modinfo.json' not in f: + continue + ident = "" + info_path = os.path.join(r, 'modinfo.json') + mod_info = json.load(open(info_path, encoding='utf-8')) + for e in mod_info: + if(e["type"] == "MOD_INFO" and + ("obsolete" not in e or not e["obsolete"])): + ident = e["id"] + if ident == "": + continue + add_mods([ident]) + for mod in os.scandir(os.path.join(r, 'mod_interactions')): + mods_this_time.append(os.path.basename(mod.path)) + print(','.join(mods_this_time)) + mods_this_time.clear() + mods_remaining = set(all_mod_dependencies) # Make sure aftershock can load by itself.