A13: Gamepad and accessibility

Gamepad: PadInput reads pad events in one fixed layout (sticks move and
look, triggers aim and fire, bumpers step slots and build pieces, Start
pauses), fed through ClientInput alongside the keys and mouse. Menus take
South to choose and East or Start to go back. The tutorial names pad
buttons once the pad is used.

Aim assist (option, on by default, pad only): friction across an
opponent in plain sight near the look, and a pull of at most 9 deg/s
while aiming. Client look only; never through cover.

Accessibility (new Access tab): colour-vision sets for the signal colours
(red-green, blue-yellow), checked by simulated colour vision in
test_palette; interface size 90-130%, with the HUD hotbar refitting at the
larger sizes; captions for key sounds with direction; reduce motion
(calmer aim zoom and hurt flash).

Tests for the pad, aim assist, captions, palettes, settings, the menus
driven from a pad, and a pad playing through a real offline session.
make access-captures renders the new screens and options.

Closes #53

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-15 08:53:30 -05:00
co-authored by Claude Opus 5.5
parent dbe1ef923a
commit 8142e39ab3
48 changed files with 1627 additions and 49 deletions
+46
View File
@@ -116,3 +116,49 @@ const GHOST_REFUSED: Color = Color(0.86, 0.32, 0.22, 0.38)
const WARNING: Color = Color(0.86, 0.32, 0.22)
## The sea on the HUD's tide gauge and map.
const SEA_INK: Color = Color(0.20, 0.34, 0.42)
# --- Colour vision (A13) ------------------------------------------------------------
## The signal colours above suit most eyes, but red against green (the build ghost) and
## rust against oilskin yellow are hard for many people to tell apart. The settings
## offer a set for each common kind of colour blindness; everything that signals asks
## for its colour through the functions below, so the set chosen applies everywhere.
## test_palette checks each set with a simulation of the colour vision it is for.
const VISION_NAMES: Array[String] = ["Standard", "Red-green (protan, deutan)", "Blue-yellow (tritan)"]
const VISION_STANDARD: int = 0
const VISION_RED_GREEN: int = 1
const VISION_BLUE_YELLOW: int = 2
## Per set: allowed and refused in the build ghost, danger, and the player's own marks.
const VISION_SIGNALS: Array[Dictionary] = [
{"ghost_ok": GHOST_OK, "ghost_refused": GHOST_REFUSED, "warning": WARNING, "own": OILSKIN},
# Blue for allowed and orange for refused; danger a deep magenta, apart from the
# yellow of the player's own marks.
{"ghost_ok": Color(0.22, 0.52, 0.95, 0.40), "ghost_refused": Color(0.98, 0.56, 0.08, 0.40),
"warning": Color(0.78, 0.16, 0.62), "own": OILSKIN},
# Teal for allowed and vermilion for refused; the player's marks turn white-blue,
# since yellow and pink run together.
{"ghost_ok": Color(0.16, 0.70, 0.74, 0.40), "ghost_refused": Color(0.90, 0.16, 0.20, 0.40),
"warning": Color(0.88, 0.14, 0.18), "own": Color(0.62, 0.86, 0.98)},
]
## Which set is in use. GameSettings.apply_to_program sets it.
static var vision: int = VISION_STANDARD:
set(value):
vision = clampi(value, 0, VISION_SIGNALS.size() - 1)
static func ghost_ok() -> Color:
return VISION_SIGNALS[vision]["ghost_ok"]
static func ghost_refused() -> Color:
return VISION_SIGNALS[vision]["ghost_refused"]
## Danger on the HUD and chart (WARNING in the standard set).
static func warning() -> Color:
return VISION_SIGNALS[vision]["warning"]
## The player's own marks on the HUD and chart (OILSKIN in the standard set).
static func own() -> Color:
return VISION_SIGNALS[vision]["own"]