Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
1.1 kB · 39 lines
Python
at main
12345678910111213141516171819202122232425262728293031323334353637383940"""Decompress Facade's zlib-packed rule files into vendor/rules/ for reading.
python tools/extract_rules.py [facade-install-folder]
vendor/ is gitignored: these are the game's files, not ours to redistribute.Read them with tools/show_rules.py."""import sysimport zlib
from facade_install import REPO, from_args
OUT = REPO / "vendor" / "rules"SUFFIXES = {".rul", ".map", ".bin"}
def main(): sources = from_args(sys.argv).sources done, skipped = 0, [] for path in sorted(sources.rglob("*")): if path.suffix.lower() not in SUFFIXES or not path.is_file(): continue try: text = zlib.decompress(path.read_bytes()) except zlib.error: skipped.append(path.name) continue target = OUT / path.relative_to(sources) target = target.with_name(target.name + ".txt") target.parent.mkdir(parents=True, exist_ok=True) target.write_bytes(text) done += 1 print("decompressed %d files into %s" % (done, OUT)) if skipped: print("not zlib, skipped: %s" % ", ".join(skipped))
if __name__ == "__main__": main()