zh locale: take ui/windows images from Longju
The character window's tabs and stat labels (VIT/INT/Character Status, Status/Abilities/...) are baked into locale/<xx>/ui/windows/windows.dds; the zh build only overlaid text keys, so they stayed English. The folder is now replaced as a whole (its .sub files index its own atlas). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
54fa2c0fc3
commit
3ae77c3530
@@ -28,6 +28,9 @@ LOCALE_CFG = "10002 936 zh\n"
|
||||
DEFAULT_NAMES = REPO / "data/zh_40250"
|
||||
FORMAT = re.compile(r"%(?:\([^)]*\))?[-+#0 ]*\d*(?:\.\d+)?[diouxXeEfFgGcrs%]")
|
||||
KEYED_FILES = ("locale_game.txt", "locale_interface.txt")
|
||||
# Image folders whose labels are drawn text (the character window's tabs and stat labels). Each is taken
|
||||
# from Longju as a whole: its .sub files carry their own coordinates into the folder's atlas.
|
||||
IMAGE_DIRS = ("ui/windows",)
|
||||
|
||||
|
||||
def keyed_lines(path: Path, encoding: str):
|
||||
@@ -166,6 +169,15 @@ def build(en: Path, zh: Path, output: Path, client_base: Path,
|
||||
if (zh / filename).is_file():
|
||||
shutil.copyfile(zh / filename, locale_dir / filename)
|
||||
|
||||
for folder in IMAGE_DIRS:
|
||||
english_files = {path.name for path in (en / folder).iterdir()}
|
||||
chinese_files = {path.name for path in (zh / folder).iterdir()}
|
||||
if not english_files <= chinese_files:
|
||||
raise ValueError(f"{folder}: Longju lacks {sorted(english_files - chinese_files)}")
|
||||
for name in sorted(english_files):
|
||||
shutil.copyfile(zh / folder / name, locale_dir / folder / name)
|
||||
report["files"][folder] = {"replaced_images": len(english_files)}
|
||||
|
||||
if proto_tool is not None:
|
||||
if not proto_tool.is_file() or names_dir is None:
|
||||
raise ValueError("build locale_proto_patch and provide the Chinese name tables")
|
||||
|
||||
Reference in New Issue
Block a user