Move debug CSVs to debug/ dir, use INI mod name for PBO prefixes
- Debug CSVs now write to debug/<mod>/ instead of output/<mod>/, so they don't get packed into PBOs and bloat size - PBO filenames use mod name from package_mod.ini (a3rebalancer_*.pbo) - Cleaned old debug CSVs from output folders
This commit is contained in:
@@ -4,5 +4,8 @@
|
|||||||
# Generated output
|
# Generated output
|
||||||
output/
|
output/
|
||||||
|
|
||||||
|
# Debug before/after tables
|
||||||
|
debug/
|
||||||
|
|
||||||
# Per-mod split data
|
# Per-mod split data
|
||||||
data/
|
data/
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ from typing import Optional
|
|||||||
REPO_ROOT = Path(__file__).resolve().parent.parent
|
REPO_ROOT = Path(__file__).resolve().parent.parent
|
||||||
DATA_DIR = REPO_ROOT / "data"
|
DATA_DIR = REPO_ROOT / "data"
|
||||||
OUTPUT_DIR = REPO_ROOT / "output"
|
OUTPUT_DIR = REPO_ROOT / "output"
|
||||||
|
DEBUG_DIR = REPO_ROOT / "debug"
|
||||||
|
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
# Caliber tier classification
|
# Caliber tier classification
|
||||||
@@ -700,10 +701,11 @@ def write_debug_csvs(
|
|||||||
armor_overrides: list[ArmorOverride],
|
armor_overrides: list[ArmorOverride],
|
||||||
):
|
):
|
||||||
"""Write per-mod debug CSVs showing old -> new values for each override."""
|
"""Write per-mod debug CSVs showing old -> new values for each override."""
|
||||||
mod_dir = OUTPUT_DIR / mod
|
mod_dir = DEBUG_DIR / mod
|
||||||
|
mod_dir.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
if ammo_overrides:
|
if ammo_overrides:
|
||||||
path = mod_dir / "debug_ammo.csv"
|
path = mod_dir / "ammo.csv"
|
||||||
with open(path, "w", encoding="utf-8", newline="") as f:
|
with open(path, "w", encoding="utf-8", newline="") as f:
|
||||||
writer = csv.writer(f, delimiter=";")
|
writer = csv.writer(f, delimiter=";")
|
||||||
writer.writerow(["classname", "source_mod", "field",
|
writer.writerow(["classname", "source_mod", "field",
|
||||||
@@ -716,7 +718,7 @@ def write_debug_csvs(
|
|||||||
field_name, old_val, new_val])
|
field_name, old_val, new_val])
|
||||||
|
|
||||||
if armor_overrides:
|
if armor_overrides:
|
||||||
path = mod_dir / "debug_armor.csv"
|
path = mod_dir / "armor.csv"
|
||||||
with open(path, "w", encoding="utf-8", newline="") as f:
|
with open(path, "w", encoding="utf-8", newline="") as f:
|
||||||
writer = csv.writer(f, delimiter=";")
|
writer = csv.writer(f, delimiter=";")
|
||||||
writer.writerow(["classname", "source_mod", "item_type",
|
writer.writerow(["classname", "source_mod", "item_type",
|
||||||
|
|||||||
@@ -166,6 +166,7 @@ def main():
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
print(f" Found {len(mod_dirs)} addon folders")
|
print(f" Found {len(mod_dirs)} addon folders")
|
||||||
|
prefix_base = mod_name.lower()
|
||||||
|
|
||||||
# Find armake2
|
# Find armake2
|
||||||
if not args.dry_run:
|
if not args.dry_run:
|
||||||
@@ -181,7 +182,7 @@ def main():
|
|||||||
print(f" [DRY RUN] Would create:")
|
print(f" [DRY RUN] Would create:")
|
||||||
print(f" {target_dir / 'mod.cpp'}")
|
print(f" {target_dir / 'mod.cpp'}")
|
||||||
for d in sorted(mod_dirs):
|
for d in sorted(mod_dirs):
|
||||||
pbo_name = f"armadump_{d.name}.pbo"
|
pbo_name = f"{prefix_base}_{d.name}.pbo"
|
||||||
print(f" {addons_dir / pbo_name}")
|
print(f" {addons_dir / pbo_name}")
|
||||||
print(f"\n Total: {len(mod_dirs)} PBOs")
|
print(f"\n Total: {len(mod_dirs)} PBOs")
|
||||||
return
|
return
|
||||||
@@ -198,7 +199,6 @@ def main():
|
|||||||
print()
|
print()
|
||||||
|
|
||||||
# Pack each addon into a PBO (all to temp first, then copy to final location)
|
# Pack each addon into a PBO (all to temp first, then copy to final location)
|
||||||
prefix_base = mod_name.lower()
|
|
||||||
packed = 0
|
packed = 0
|
||||||
failed = 0
|
failed = 0
|
||||||
temp_dir = OUTPUT_DIR / "_pack_temp"
|
temp_dir = OUTPUT_DIR / "_pack_temp"
|
||||||
@@ -206,7 +206,7 @@ def main():
|
|||||||
addons_temp.mkdir(parents=True, exist_ok=True)
|
addons_temp.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
for d in sorted(mod_dirs):
|
for d in sorted(mod_dirs):
|
||||||
pbo_name = f"armadump_{d.name}.pbo"
|
pbo_name = f"{prefix_base}_{d.name}.pbo"
|
||||||
temp_pbo = addons_temp / pbo_name
|
temp_pbo = addons_temp / pbo_name
|
||||||
prefix = f"{prefix_base}\\{d.name}"
|
prefix = f"{prefix_base}\\{d.name}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user