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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user