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
+9
View File
@@ -0,0 +1,9 @@
[gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://test/capture/camera_scene.gd" id="1"]
[node name="CaptureCameraAim" type="Node3D"]
script = ExtResource("1")
yaw_degrees = 20.0
aiming = true
reduce_motion = true
+3
View File
@@ -6,6 +6,8 @@ extends "res://test/capture/smoke_scene.gd"
@export var yaw_degrees: float = 0.0
@export var pitch_degrees: float = -8.0
@export var aiming: bool = false
## A13: the calmer aim zoom of the reduce-motion setting.
@export var reduce_motion: bool = false
func _add_camera() -> void:
@@ -19,6 +21,7 @@ func _add_camera() -> void:
camera.yaw = deg_to_rad(yaw_degrees)
camera.pitch = deg_to_rad(pitch_degrees)
camera.aiming = aiming
camera.rig.reduce_motion = reduce_motion
if aiming:
camera.rig.aim_blend = 1.0
add_child(camera)
+8
View File
@@ -0,0 +1,8 @@
[gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://test/capture/client_scene.gd" id="1"]
[node name="CaptureClient" type="Node3D"]
script = ExtResource("1")
stage = "build"
vision = 1
@@ -0,0 +1,8 @@
[gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://test/capture/client_scene.gd" id="1"]
[node name="CaptureClient" type="Node3D"]
script = ExtResource("1")
stage = "build_refused"
vision = 1
+8
View File
@@ -0,0 +1,8 @@
[gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://test/capture/client_scene.gd" id="1"]
[node name="CaptureClient" type="Node3D"]
script = ExtResource("1")
stage = "hud"
captions = true
+9
View File
@@ -0,0 +1,9 @@
[gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://test/capture/client_scene.gd" id="1"]
[node name="CaptureClient" type="Node3D"]
script = ExtResource("1")
stage = "hud"
captions = true
ui_scale = 1.3
+23
View File
@@ -24,6 +24,11 @@ const LIMIT_ROUNDS: int = 200 * Tuning.TICK_RATE_HZ
@export var stage: String = "barge"
@export var match_seed: int = 2
@export var bots: int = 23
## A13: a colour-vision set (Palette.VISION_*), captions for the sounds of the last
## second before the picture, and the interface size.
@export var vision: int = 0
@export var captions: bool = false
@export var ui_scale: float = 1.0
var _loop: ServerLoop
var _net: NetServer
@@ -32,6 +37,8 @@ var _session: ClientSession
func _ready() -> void:
Palette.vision = vision
get_tree().root.content_scale_factor = ui_scale
var rules: MatchRules = MatchRules.new()
rules.max_players = bots + 1
rules.lobby_ticks = 6
@@ -104,6 +111,22 @@ func _ready() -> void:
return
basin_text += downed_text
_session.hud.fade_feed = false
if captions:
# A second of play with its sound, which is what the captions hear.
_session.settings.captions = true
# Play on until something worth a caption is heard (bots' gunfire carries far),
# for up to 20 seconds.
for _frame: int in 20 * Tuning.TICK_RATE_HZ:
if _session.captions.lines().size() >= 2:
break
_game.poll()
_loop.run_tick()
_game.after_tick()
_session.pump(DT)
_session.sound.update(_session.game, _session.mirror.own_id, _session.view.camera.global_position, DT)
_session._hear_captions(DT)
if _session.captions.lines().is_empty():
push_error("client capture: nothing was captioned")
_session.hud.show_state(_session.hud_state())
_session.view.settle()
var others: int = 0
+9
View File
@@ -0,0 +1,9 @@
[gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://test/capture/menu_scene.gd" id="1"]
[node name="CaptureMenu" type="Control"]
script = ExtResource("1")
screen = "main"
over_match = false
ui_scale = 1.3
+3
View File
@@ -8,9 +8,12 @@ extends Control
@export var screen: String = "main"
@export var over_match: bool = false
@export var settings_tab: int = 0
## A13: the interface size (GameSettings.UI_SCALES).
@export var ui_scale: float = 1.0
func _ready() -> void:
get_tree().root.content_scale_factor = ui_scale
set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
if over_match:
var stand_in: MenuBackdrop = MenuBackdrop.new()
+9
View File
@@ -0,0 +1,9 @@
[gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://test/capture/menu_scene.gd" id="1"]
[node name="CaptureMenu" type="Control"]
script = ExtResource("1")
screen = "settings"
over_match = false
settings_tab = 6
+9
View File
@@ -0,0 +1,9 @@
[gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://test/capture/menu_scene.gd" id="1"]
[node name="CaptureMenu" type="Control"]
script = ExtResource("1")
screen = "settings"
over_match = false
settings_tab = 2
+10
View File
@@ -0,0 +1,10 @@
[gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://test/capture/menu_scene.gd" id="1"]
[node name="CaptureMenu" type="Control"]
script = ExtResource("1")
screen = "settings"
over_match = false
settings_tab = 6
ui_scale = 1.3