mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-20 04:35:57 +00:00
Find the resource size table by any ResourceSizeTable.*.rsizetable.zs name, as MacNativeGames does
The prompts then do not fail on a table named without Nin_NX_NVN; the test RomFS of 1.4.3 uses that form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0598032cc4
commit
19fb3a75c9
2 files changed
+9
-6
No files matched your search
@@ -43,7 +43,9 @@ FACE = {'A': 0xE040, 'B': 0xE041, 'X': 0xE042, 'Y': 0xE043}
|
||||
DRAWN = {0xE044: 820, 0xE045: 820, 0xE046: 760, 0xE047: 760, 0xE04B: 640, 0xE04C: 640, 0xE049: 640,
|
||||
**{cp: 640 for cp in range(0xE060, 0xE066)}}
|
||||
|
||||
VERSIONS = {'v121': dict(common='110', size=72, newest=121), 'v143': dict(common='140', size=108, newest=143)}
|
||||
# restbl: the resource size table's name after its version, in both forms the tool takes.
|
||||
VERSIONS = {'v121': dict(common='110', size=72, newest=121, restbl='Nin_NX_NVN.rsizetable.zs'),
|
||||
'v143': dict(common='140', size=108, newest=143, restbl='rsizetable.zs')}
|
||||
DEFAULT_FONT, REGIONAL_FONT = 'Font/Font.Nin_NX_NVN.bfarc.zs', 'Font/Font_KRko.Nin_NX_NVN.bfarc.zs'
|
||||
PANES = {'T_A_00': 'A', 'T_B_00': 'B', 'T_X_00': 'X', 'T_Y_00': 'Y', 'T_Name_00': 'A'}
|
||||
MESSAGES = {**PANES, 'Greeting': 'Hello'}
|
||||
@@ -308,8 +310,8 @@ class Romfs:
|
||||
self.common = f'UI/LayoutArchive/Common.Product.{v["common"]}.Nin_NX_NVN.blarc.zs'
|
||||
self.mals = [f'Mals/EUen.Product.{v["newest"]}.sarc.zs', f'Mals/USen.Product.{v["newest"]}.sarc.zs']
|
||||
self.old_mals = 'Mals/USen.Product.110.sarc.zs'
|
||||
self.restbl = f'System/Resource/ResourceSizeTable.Product.{v["newest"]}.Nin_NX_NVN.rsizetable.zs'
|
||||
self.old_restbl = 'System/Resource/ResourceSizeTable.Product.100.Nin_NX_NVN.rsizetable.zs'
|
||||
self.restbl = f'System/Resource/ResourceSizeTable.Product.{v["newest"]}.{v["restbl"]}'
|
||||
self.old_restbl = f'System/Resource/ResourceSizeTable.Product.100.{v["restbl"]}' # an older version's: left alone
|
||||
size = v['size']
|
||||
images = {f'Nt_KeyTex{b}_00': (R8_UNORM, size, rnd.randbytes(IMAGE)) for b in 'ABXY'}
|
||||
images.update({'Nt_KeyTexL_00^z': (l_format, size, rnd.randbytes(IMAGE)),
|
||||
|
||||
@@ -225,9 +225,10 @@ for p in files:
|
||||
MALS[m[1]] = (int(m[2]), p)
|
||||
MALS = sorted(p for _, p in MALS.values())
|
||||
LAYOUT_MSG = 'LayoutMsg/DoCommand_00.msbt'
|
||||
# The resource size table, likewise the newest version in the RomFS.
|
||||
RESTBL = max((p for p in files if re.fullmatch(r'System/Resource/ResourceSizeTable\.Product\.\d+\.[\w.]*rsizetable\.zs', p)),
|
||||
key=lambda p: int(re.search(r'\.Product\.(\d+)\.', p)[1]), default=None)
|
||||
# The resource size table (System/Resource/ResourceSizeTable.Product.<n>...rsizetable.zs, matched as loosely as
|
||||
# MacNativeGames make_button_icons.py does), likewise the newest version in the RomFS.
|
||||
RESTBL = max((p for p in files if p.startswith('System/Resource/ResourceSizeTable.') and p.endswith('.rsizetable.zs')),
|
||||
key=lambda p: int((re.search(r'\.(\d+)\.', p) or [0, 0])[1]), default=None)
|
||||
by_position = args.prompts == 'xbox' # the face buttons' prompts swapped to the labels (pad_layout = nintendo)
|
||||
if args.prompts:
|
||||
assert FONTS, 'no Font/Font*.Nin_NX_NVN.bfarc.zs in the RomFS'
|
||||
|
||||
Reference in new issue
Block a user