mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-21 14:29:58 -04:00
Show what the check of the game files found.
The check printed its counts into the build's lines only, so a player whose build ended with "4 damaged, 3 given a stand-in, 1 left as they are" saw nothing of it. A job now reads romfs-check.json after the build: the count goes into the step's row, and when the check ran in that job, a sentence goes onto the home screen and into launcher.log. The same four files are flagged on every copy of the game, and three of them get a stand-in. For those the sentence says so and that nothing needs doing; other files are counted and romfs-check.json is named. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -148,6 +148,17 @@ def built_version(game_dir):
|
||||
return ''
|
||||
|
||||
|
||||
def scan_report(game_dir):
|
||||
"""What the check of the game files found (tools/romfs_check.py writes <game>/romfs-check.json): (the paths of
|
||||
the damaged files, how many of them got a stand-in), or None when the folder has no readable report."""
|
||||
try:
|
||||
with open(os.path.join(str(game_dir), 'romfs-check.json'), encoding='utf-8') as f:
|
||||
report = json.load(f)
|
||||
return sorted(report['damaged']), len(report.get('repaired') or ())
|
||||
except (OSError, ValueError, KeyError, TypeError):
|
||||
return None
|
||||
|
||||
|
||||
def can_rebuild(game_dir):
|
||||
st = build_state(game_dir)
|
||||
return st.get('version') == 2 and all(s in st.get('steps', {}) for s in ('exefs', 'romfs'))
|
||||
|
||||
Reference in New Issue
Block a user