Add wrapping keyboard and gamepad focus rings
Full build / Import + headless tests (push) Successful in 36s
Full build / Full desktop build + optional release (push) Skipped

- Link every modal's enabled controls into a wrapping UiFocus ring and give each screen a default focus target.
- Add gamepad A/B bindings for ui_accept/ui_cancel; include Start menu footer actions and Continue in its focus ring.
- Skip hidden/disabled controls, close focus traps via per-modal cancel behavior, and return review to the menu on cancel.
- Record the focus audit and add regression coverage.
This commit is contained in:
Gig Line Dev committed 2026-11-02 16:05:53 +01:00
1 parent 9692f262f1
commit 8f65751975
17 files changed
+262 -76

No files matched your search

+14
View File
@@ -4,6 +4,7 @@ extends RefCounted
## theme when a control is focused or disabled.
const UiStyles := preload("res://src/game/ui/ui_styles.gd")
const UiFocus := preload("res://src/game/ui/ui_focus.gd")
func test_shared_button_states_are_complete() -> bool:
var button := Button.new()
@@ -24,3 +25,16 @@ func test_shared_button_states_are_complete() -> bool:
"the disabled state is visually distinct from normal")
button.free()
return a and b and c
func test_focus_helper_skips_hidden_and_disabled_controls() -> bool:
var hidden := Button.new()
hidden.visible = false
var disabled := Button.new()
disabled.disabled = true
var normal := Button.new()
var first := UiFocus.first_enabled([hidden, disabled, normal])
var a := TestUtils.check_eq(first, normal, "focus skips hidden and disabled controls")
hidden.free()
disabled.free()
normal.free()
return a