From 3336b2f661d14784425e9aa0d9723efe4c8f7ad3 Mon Sep 17 00:00:00 2001 From: indifferentketchup Date: Mon, 4 May 2026 16:21:35 +0000 Subject: [PATCH] feat: build-suffix labels for [add] actions; chain RV Interior Expansion after Project RV B42 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Label format change ('!missing' actions): - "add TrueMoozic (renamed from truemusic)" → "add TrueMoozic B42" - "add truemusic" → "add truemusic B41" Build context lives in the suffix; the alias-rename hint was redundant because the user already sees the original mod_id in the warning text. RV Interior Expansion ordering (B42): PROJECTRVInterior42 → RVInteriorExpansion → RVInteriorExpansionPart2 map folders: map_distanciado → map_aquatsar → rvupdate → rv2 → Muldraugh, KY Authors didn't declare loadAfter in mod.info; new modpack rules file data/modpack_rules/rv_expansion.txt establishes the chain. Triggers fire when either expansion wsid (3618427553 / 3622163276) is in input. --- api/adapters.py | 13 +++++++------ api/app.py | 7 +++++++ data/modpack_rules/rv_expansion.txt | 19 +++++++++++++++++++ 3 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 data/modpack_rules/rv_expansion.txt diff --git a/api/adapters.py b/api/adapters.py index cc66d2d..1e028e3 100644 --- a/api/adapters.py +++ b/api/adapters.py @@ -87,6 +87,7 @@ def build_warnings( wsid_lookup: Dict[str, Tuple[str, str]] | None = None, source_wsids: Dict[str, str] | None = None, input_modids: Set[str] | None = None, + pz_build: str = "B42", ) -> List[Dict[str, Any]]: """Translate mlos_sort warnings to the SORTOF_DATA WARNINGS shape. @@ -126,16 +127,15 @@ def build_warnings( entry = lookup.get(dep) if entry: wsid, suggested = entry - # If MOD_ID_ALIASES rewrote the suggestion (B42 user needing - # B41 mod_id `truemusic` gets `TrueMoozic` instead), surface - # both names so the user understands what's being added. - label = (f"add {suggested}" if suggested == dep - else f"add {suggested} (renamed from {dep})") + # The build suffix tells the user which build the suggested + # wsid is for. Both canonical and MOD_ID_ALIASES branches + # land on the user's pz_build (the lookup helper already + # filtered wrong-build wsids out). actions.append({ "type": "add-wsid", "wsid": wsid, "modId": suggested, - "label": label, + "label": f"add {suggested} {pz_build}", }) else: # No cache hit -> link to Steam Workshop search so the user @@ -665,6 +665,7 @@ def build_response( wsid_lookup, source_wsids=source_wsids, input_modids=input_modids, + pz_build=pz_build, ) if drop_ids: kept_warnings: List[Dict[str, Any]] = [] diff --git a/api/app.py b/api/app.py index 60829ba..c10b407 100644 --- a/api/app.py +++ b/api/app.py @@ -342,11 +342,18 @@ _MODPACK_RULES_TRIGGERS: Dict[str, str] = { # HellDrinx FULL + LITE both bundle the same sorting_rules.txt. "3672556207": "helldrinx.txt", # HellDrinx FULL "3662909244": "helldrinx.txt", # HellDrinx LITE + # RVInteriorExpansion + Part2 chain after PROJECTRVInterior42. + # Expansion authors didn't declare loadAfter in their mod.info; without + # these rules sortof has no signal to chain the cluster. + "3618427553": "rv_expansion.txt", # RVInteriorExpansion (rvupdate) + "3622163276": "rv_expansion.txt", # RVInteriorExpansionPart2 (rv2) } # Human-readable trigger labels for the warning message. _MODPACK_RULES_LABELS: Dict[str, str] = { "3672556207": "HellDrinx FULL", "3662909244": "HellDrinx LITE", + "3618427553": "RV Interior Expansion", + "3622163276": "RV Interior Expansion Part 2", } diff --git a/data/modpack_rules/rv_expansion.txt b/data/modpack_rules/rv_expansion.txt new file mode 100644 index 0000000..01becc3 --- /dev/null +++ b/data/modpack_rules/rv_expansion.txt @@ -0,0 +1,19 @@ +; RV Interior Expansion (B42) — bundled sorting_rules.txt +; Triggers: +; - 3618427553 (RVInteriorExpansion, map folder rvupdate) +; - 3622163276 (RVInteriorExpansionPart2, map folder rv2) +; Auto-injected by app.py:_modpack_rules_for() when either trigger wsid is +; in the user's input. User-supplied rules are appended afterward and +; override these on conflicting keys. +; +; Authored ordering: PROJECTRVInterior42 → RVInteriorExpansion → RVInteriorExpansionPart2. +; The expansion mods don't declare these loadAfter relationships in their own +; mod.info, so without these rules sortof has nothing to base the cluster +; ordering on (PROJECTRVInterior42 is in PREORDER slot 7 already; expansions +; just need to chain off of it). + +[RVInteriorExpansion] +loadAfter=PROJECTRVInterior42 + +[RVInteriorExpansionPart2] +loadAfter=RVInteriorExpansion