Skip to content

Commit 6f49bdf

Browse files
committed
Remove duplicate files
1 parent b433257 commit 6f49bdf

File tree

3 files changed

+15
-50
lines changed

3 files changed

+15
-50
lines changed

scripts/japanese_names.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
$PCTRTools = "tools/PCTRTools/bin/Release/net8.0/publish/PCTRTools.exe"
2+
$env:XZ_PATCH_JAPANESE = "1"
23

3-
python scripts/merge_messages_for_japanese_names.py
4+
python scripts/merge_messages.py
45

56
& "$PCTRTools" "text-import" -c "files/CharTable.txt" -i "original_files/DP/data/msgdata/msg.narc" -t "temp/DP/messages_J.txt" -o "out/DP_J/data/msgdata/msg.narc"
67
& "$PCTRTools" "text-import" -c "files/CharTable.txt" -i "original_files/Pt/data/msgdata/pl_msg.narc" -t "temp/Pt/messages_J.txt" -o "out/Pt_J/data/msgdata/pl_msg.narc"

scripts/merge_messages.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@
33
from helper import DIR_TEMP, DIR_TEXTS, GAMES, GameInfo, load_game_data
44

55

6-
def merge_messages(games: list[GameInfo], texts_root: str, output_root: str):
6+
def merge_messages(games: list[GameInfo], texts_root: str, output_root: str, is_japanese: bool = False):
77
version = os.environ.get("XZ_PATCH_VERSION", "UNKNOWN")[:7]
8+
if is_japanese:
9+
version += "+J"
810

911
for game_info in games:
1012
game = game_info["game"]
1113
file_name = game_info["file_name"]
14+
if is_japanese:
15+
file_name = file_name.replace(".txt", "_J.txt")
1216
languages = game_info["languages"]
1317
game_data = load_game_data(game_info, texts_root)
1418

@@ -18,6 +22,8 @@ def merge_messages(games: list[GameInfo], texts_root: str, output_root: str):
1822
writer.write("#4\n")
1923
for lang_i, language in enumerate(languages):
2024
for file_id in file_ids:
25+
if is_japanese and f"{game}-{file_id}" in {"DP-324", "DP-356", "Pt-369", "Pt-408", "HGSS-198", "HGSS-232"}:
26+
continue
2127
lines = game_data[language].get(file_id, game_data[languages[0]][file_id])
2228
if len(lines) == 0:
2329
continue
@@ -28,13 +34,18 @@ def merge_messages(games: list[GameInfo], texts_root: str, output_root: str):
2834
writer.write(f"{file_id}-{lang_i}\n")
2935

3036
for i, line in lines.items():
37+
if is_japanese and f"{game}-{file_id}" in {"DP-13", "DP-23", "Pt-17"} and line.startswith("盒子"):
38+
continue
39+
3140
line = (
3241
line.replace("\\f\n", "\\f").replace("\\r\n", "\\r").replace("\n", "\\n").replace("${VERSION}", version)
3342
)
43+
3444
writer.write(f"{i}\t{line}\n")
3545

3646
print(f"Merged: {game}/{file_name}")
3747

3848

3949
if __name__ == "__main__":
40-
merge_messages(GAMES, DIR_TEXTS, DIR_TEMP)
50+
is_japanese = os.environ.get("XZ_PATCH_JAPANESE", "0") == "1"
51+
merge_messages(GAMES, DIR_TEXTS, DIR_TEMP, is_japanese)

scripts/merge_messages_for_japanese_names.py

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)