Compare commits
4 commits
master
...
extract-sc
Author | SHA1 | Date | |
---|---|---|---|
6ce883eac2 | |||
d619b92504 | |||
5c366d1f02 | |||
cb17043e41 |
1 changed files with 21 additions and 20 deletions
41
scripts/extract.py
Normal file → Executable file
41
scripts/extract.py
Normal file → Executable file
|
@ -1,3 +1,4 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2020-2021 The reone project contributors
|
# Copyright (c) 2020-2021 The reone project contributors
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
@ -21,26 +22,28 @@ TODO: support case sensitive paths (Unix)
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import sys
|
||||||
|
|
||||||
from reo_shared import *
|
from reo_shared import *
|
||||||
|
|
||||||
game_dir = r"D:\Games\Star Wars - KotOR"
|
game_dir = os.getenv("REONE_GAME_DIR")
|
||||||
tools_dir = r"D:\Source\reone\build\bin\RelWithDebInfo"
|
tools_dir = os.getenv("REONE_TOOLS_DIR")
|
||||||
extract_dir = r"D:\OpenKotOR\Extract\KotOR"
|
extract_dir = os.getenv("REONE_EXTRACT_DIR")
|
||||||
nwnnsscomp_dir = r"D:\OpenKotOR\Tools\DeNCS"
|
nwnnsscomp_dir = os.getenv("REONE_NWNNSSCOMP_DIR")
|
||||||
|
|
||||||
steps = [
|
steps = [
|
||||||
["extract_bifs", "Extract BIF files (y/n)?", None],
|
["extract_bifs", "Extract BIF files (y/n)?"],
|
||||||
["extract_patch", "Extract patch.erf (y/n)?", None],
|
["extract_patch", "Extract patch.erf (y/n)?"],
|
||||||
["extract_modules", "Extract modules (y/n)?", None],
|
["extract_modules", "Extract modules (y/n)?"],
|
||||||
["extract_dialog", "Extract dialog.tlk (y/n)?", None],
|
["extract_dialog", "Extract dialog.tlk (y/n)?"],
|
||||||
["extract_textures", "Extract texture packs (y/n)?", None],
|
["extract_textures", "Extract texture packs (y/n)?"],
|
||||||
["extract_voices", "Extract streamwaves/streamvoices (y/n)?", None],
|
["extract_voices", "Extract streamwaves/streamvoices (y/n)?"],
|
||||||
["extract_lips", "Extract LIP files (y/n)?", None],
|
["extract_lips", "Extract LIP files (y/n)?"],
|
||||||
["convert_to_json", "Convert 2DA, GFF, TLK and LIP to JSON (y/n)?", None],
|
["convert_to_json", "Convert 2DA, GFF, TLK and LIP to JSON (y/n)?"],
|
||||||
["convert_to_tga", "Convert TPC to TGA/TXI (y/n)?", None],
|
["convert_to_tga", "Convert TPC to TGA/TXI (y/n)?"],
|
||||||
["convert_to_ascii_pth", "Convert binary PTH to ASCII PTH (y/n)?", None],
|
["convert_to_ascii_pth", "Convert binary PTH to ASCII PTH (y/n)?"],
|
||||||
["disassemble_scripts", "Disassemble NCS scripts (y/n)?", None] ]
|
["disassemble_scripts", "Disassemble NCS scripts (y/n)?"]
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def extract_bifs(game_dir, extract_dir):
|
def extract_bifs(game_dir, extract_dir):
|
||||||
|
@ -219,12 +222,10 @@ if not is_valid_extract_dir(extract_dir):
|
||||||
if not is_valid_extract_dir(extract_dir):
|
if not is_valid_extract_dir(extract_dir):
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
assume_yes = len(sys.argv) > 1 and sys.argv[1] == '-y'
|
||||||
|
|
||||||
for step in steps:
|
for step in steps:
|
||||||
if step[2] is None:
|
run = assume_yes or input(step[1] + " ").lower()[0] == 'y'
|
||||||
choice = input(step[1] + " ")
|
|
||||||
run = choice.lower()[0] == 'y'
|
|
||||||
else:
|
|
||||||
run = step[2]
|
|
||||||
|
|
||||||
if run:
|
if run:
|
||||||
if step[0] == "extract_bifs":
|
if step[0] == "extract_bifs":
|
||||||
|
|
Loading…
Reference in a new issue