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:
@@ -214,3 +214,25 @@ func test_a_down_in_duos_travels_in_the_feed_and_reads_as_a_down() -> void:
|
||||
assert_eq(lines[0]["text"], "You knocked Thole down")
|
||||
assert_eq(lines[1]["text"], "Brine is down")
|
||||
assert_eq(HudState.feed_lines(told["entries"], -3)[0]["text"], "Ada knocked you down")
|
||||
|
||||
|
||||
func test_the_bottom_row_never_overlaps_at_any_interface_size() -> void:
|
||||
# A13: the interface size makes the canvas narrower; the hotbar must stay clear of
|
||||
# the vitals and the materials, and inside the screen.
|
||||
for scale: float in GameSettings.UI_SCALES:
|
||||
var hud: Hud = Hud.new()
|
||||
var canvas: Vector2 = Vector2(1280.0, 720.0) / scale
|
||||
hud.size = canvas
|
||||
var state: HudState = HudState.new()
|
||||
state.playing = true
|
||||
for index: int in 6:
|
||||
state.slots.append({"id": "", "name": "Slot", "count": 0, "rounds": 0, "reserve": 0, "magazine": 0, "tier": -1, "selected": index == 0, "empty": true})
|
||||
hud.show_state(state)
|
||||
var bar: Rect2 = hud.hotbar_rect()
|
||||
assert_true(bar.position.x >= hud.vitals_rect().end.x + 1.0, "at %d%% the hotbar starts after the vitals: %s" % [roundi(scale * 100.0), bar])
|
||||
var materials_left: float = canvas.x - Hud.MARGIN - hud.materials_rect().size.x
|
||||
assert_true(bar.end.x <= materials_left - 1.0, "at %d%% the hotbar ends before the materials (%.0f, %.0f)" % [roundi(scale * 100.0), bar.end.x, materials_left])
|
||||
assert_true(bar.size.x >= 6.0 * Hud.SLOT_MIN_WIDTH, "slots no narrower than the least")
|
||||
if is_equal_approx(scale, 1.0):
|
||||
assert_near(bar.get_center().x, canvas.x * 0.5, 1.0, "centred at 100%")
|
||||
hud.free()
|
||||
|
||||
Reference in New Issue
Block a user