#38: touch action buttons

TouchButtons (phones only, Main adds it beside TouchSticks): Pause, Fear, Bomb,
Patch, Use (word from the new read-only Interactions.focus_info()) and Build,
round Sketch buttons that press the existing actions for at least one physics
tick, shown only when they can do something and hidden whenever the tree is
paused or a menu, panel or sign is up. Columns follow TouchSticks.move_on_right
(now a variable); both join "touch_controls" with apply_settings (Swap sticks),
which Main calls at startup; Prompts.move_side() reads the live sticks. Stick
fingers keep their drags over buttons. New Sketch icons: fear, patch, use,
build, pause. Test: game/tests/mobile/buttons_test.gd.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Forrest 2026-10-14 15:25:57 -04:00
parent 5392ae09af
commit e435b76aa2
9 changed files with 1115 additions and 48 deletions

View file

@ -30,10 +30,11 @@ static func touch() -> bool:
return MobilePort.active()
## The screen half the move stick is on: "right" or "left".
## #38 points this at TouchSticks' move_on_right variable (which #41's Swap setting flips).
## The screen half the move stick is on: "right" or "left", as the sticks in play have it
## (TouchSticks.move_on_right_now(): their move_on_right, which the Swap sticks setting flips;
## TouchSticks.MOVE_ON_RIGHT without them).
static func move_side() -> String:
return "right" if TouchSticks.MOVE_ON_RIGHT else "left"
return "right" if TouchSticks.move_on_right_now() else "left"
## The screen half the attack stick is on: the other one.