Version 3.1.0: voice lines linked across all languages from the game data
This commit is contained in:
@@ -29,9 +29,6 @@ def sha(p):
|
||||
|
||||
def main():
|
||||
from PySide6.QtWidgets import QApplication
|
||||
from ackit import audio
|
||||
from ackit.inject import pack_bnk_path, parse_target
|
||||
from ackit.verify import ingame
|
||||
from app.mainwindow import MainWindow
|
||||
from app.workers import Runner
|
||||
|
||||
@@ -45,6 +42,21 @@ def main():
|
||||
ws = w.ws
|
||||
assert ws, "game not loaded"
|
||||
ok = True
|
||||
try:
|
||||
ok = run(w, ws, errors)
|
||||
finally: # never leave a change behind, whatever failed
|
||||
ws.revert_all()
|
||||
ws.texts.revert_all()
|
||||
print("E2E EDITOR %s" % ("PASS" if ok else "FAIL"))
|
||||
w.close()
|
||||
return 0 if ok else 1
|
||||
|
||||
|
||||
def run(w, ws, errors):
|
||||
from ackit import audio
|
||||
from ackit.inject import pack_bnk_path, parse_target
|
||||
from ackit.verify import ingame
|
||||
ok = True
|
||||
with tempfile.TemporaryDirectory() as td:
|
||||
# --- music (stream pack, resized) ---
|
||||
s = ws.sound("Music_393BC53A")
|
||||
@@ -71,10 +83,11 @@ def main():
|
||||
ok &= same
|
||||
|
||||
# --- speech line (in place) ---
|
||||
t = ws.sound("Speech_TAPE_JOKER_1_4")
|
||||
t = ws.sound("Speech_TAPE_JOKER_1#4") # 4th WEM of that entry in this language's WAD
|
||||
twad = ws.wad_path(t)
|
||||
tb = sha(twad)
|
||||
w.select_name("Speech_TAPE_JOKER_1_4") or (w.clear_filters(), w.select_name("Speech_TAPE_JOKER_1_4"))
|
||||
w.clear_filters()
|
||||
assert w.select_name(t.name)
|
||||
y, ysr = audio.decode_wem(ws.original_bytes(t))
|
||||
line = os.path.join(td, "line.wav")
|
||||
audio.save_wav(line, y[::-1], ysr) # reversed speech, same length
|
||||
@@ -86,9 +99,7 @@ def main():
|
||||
same2 = sha(twad) == tb
|
||||
print("speech line applied (WAD changed: %s), reverted byte-identical: %s" % (changed, same2))
|
||||
ok &= changed and same2
|
||||
print("E2E EDITOR %s" % ("PASS" if ok else "FAIL"))
|
||||
w.close()
|
||||
return 0 if ok else 1
|
||||
return ok
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user