Shipwright/OTRExporter/extract_assets.py
aMannus 1c384c5b3e Revert "Merge branch 'develop-zhora' into rando-settings-overhaul"
This reverts commit 55f114e3d499f510eadab5f918b7eb95fd9dd249, reversing
changes made to 2809cd01dffb7f1a1df1068adaae8f2b1b44ae85.
2022-07-19 13:09:24 +02:00

33 lines
917 B
Python
Executable File

#!/usr/bin/env python3
import os, sys, shutil
import shutil
from rom_info import Z64Rom
import rom_chooser
def BuildOTR(xmlPath, rom):
shutil.copytree("assets", "Extract/assets")
execStr = "x64\\Release\\ZAPD.exe" if sys.platform == "win32" else "../ZAPDTR/ZAPD.out"
execStr += " ed -i %s -b %s -fl CFG/filelists -o placeholder -osf placeholder -gsf 1 -rconf CFG/Config.xml -se OTR" % (xmlPath, rom)
print(execStr)
exitValue = os.system(execStr)
if exitValue != 0:
print("\n")
print("Error when building the OTR file...", file=os.sys.stderr)
print("Aborting...", file=os.sys.stderr)
print("\n")
def main():
rom_path = rom_chooser.chooseROM()
rom = Z64Rom(rom_path)
if (os.path.exists("Extract")):
shutil.rmtree("Extract")
BuildOTR("../soh/assets/xml/" + rom.version.xml_ver + "/", rom_path)
if __name__ == "__main__":
main()