Version 3.1.0: voice lines linked across all languages from the game data

This commit is contained in:
2026-10-10 14:10:03 +02:00
parent ea3e44000a
commit fbde809370
56 changed files with 74728 additions and 73360 deletions

View File

@@ -38,9 +38,10 @@ def test_synthetic_catalog_names_and_search(synth_game):
root, _ = synth_game
cat = Catalog(Game(root), ["INT", "SFX"])
names = {s.name for s in cat.sounds}
assert {"CHR_RadioScanner_1", "CHR_RadioScanner_2", "CHR_RadioScanner_3", "Music_393BC53A"} <= names
assert {"CHR_RadioScanner_1", "Speech_Synth_Radio_02", "CHR_RadioScanner_3", "Music_393BC53A"} <= names
s = cat.resolve("CHR_RadioScanner#2")
assert s.target.endswith(":1") and cat.resolve("chr_radioscanner_2.wav") is s
assert s.target.endswith(":1") and cat.resolve("speech_synth_radio_02.wav") is s
assert s.line and s.name == "Speech_Synth_Radio_02" # the game's line: named after its event
assert cat.resolve(s.key) is s
assert [x.name for x in cat.search("radio scanner 3")] == ["CHR_RadioScanner_3"]
with pytest.raises(LookupError) as e:
@@ -108,8 +109,9 @@ def test_real_game_uses_shipped_catalog(real_game_dir):
g = Game(real_game_dir)
cat = Catalog(g, ["ITA", "SFX", "BANK"])
bank = read_csv(os.path.join(catalog_dir(), "BANK.csv"))
assert len(cat.sounds) == 10816 + 651 + sum(1 for s in bank if s.language in ("", "ITA"))
assert {s.language for s in cat.sounds if s.archive == "BANK"} == {"", "ITA"}
assert len(cat.sounds) == 10816 + 651 + sum(1 for s in bank if s.in_language("ITA"))
assert all(s.in_language("ITA") for s in cat.sounds if s.archive == "BANK")
assert all(s.line for s in cat.sounds if s.archive == "ITA" and s.group == "Speech") # every voice line
s = cat.resolve("Speech_TAPE_JOKER_1#4") # position 4 in the ITA entry (the user's list name)
assert s.category == "Interview tapes" and s.size == 44985 and s.name.startswith("Speech_TAPE_JOKER_1_")
assert len(cat.heads) == 396 and sum(len(v) for v in cat.heads.values()) == 2101