The Shapes step keeps its old key when it writes no capped HUD folder, so an install with hud_width full does not prepare its shaped folders again (#643)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Valiantsin DzerakhandClaude Opus 5.5 committed 2026-11-17 20:12:56 +03:00
1 parent 006c186928
commit c781238d6d
2 files changed
+22 -2

No files matched your search

+16
View File
@@ -931,6 +931,22 @@ class ShapesTest(unittest.TestCase):
self.assertTrue(all('--hud' not in c for c in self.calls))
self.assertFalse((self.dest / 'romfs-patches-2560x1080-hud16x9').exists())
def test_full_hud_keeps_the_key_of_a_setup_before_hud_width(self):
# An install that writes no capped folder keeps the Shapes key it had, so its next setup run prepares nothing
screens.displays = lambda: [(2560, 1080), (2560, 1600)]
step = steps.Shapes()
sizes, style = step.wanted(self.ctx)
old = steps.fingerprint('shapes-2', 'p', '', style or 'nintendo', *sizes)
self.assertEqual(step.key(self.ctx), old)
(self.dest / 'totk.ini').write_text('hud_width = full\n')
self.assertEqual(step.key(self.ctx), old)
# a cap no shape here is wider than writes nothing either
screens.displays = lambda: [(2560, 1600)]
del self.ctx.shapes_wanted
(self.dest / 'totk.ini').write_text('hud_width = 16:9\n')
sizes, style = step.wanted(self.ctx)
self.assertEqual(step.key(self.ctx), steps.fingerprint('shapes-2', 'p', '', style or 'nintendo', *sizes))
def test_capped_pc_prompts_reuse_bindings(self):
screens.displays = lambda: [(3840, 1080)]
(self.dest / 'totk.ini').write_text('prompts = pc\nhud_width = 16:9\nbind_attack = key:f\n')