#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:
parent
5392ae09af
commit
e435b76aa2
9 changed files with 1115 additions and 48 deletions
|
|
@ -20,9 +20,10 @@ extends Node
|
|||
## host's leaving ends the partner's game (back to this menu, which says why), the partner's
|
||||
## leaving leaves the host alone. [M] mutes the microphone.
|
||||
## * On a phone (MobilePort): no ToonLook (Main adds the ScreenLabels that draws the Label3Ds
|
||||
## flat), no co-op, no Quit buttons, two thumbsticks (TouchSticks), and leaving the app
|
||||
## pauses. Android's back button (go_back) closes what's on top or pauses, and quits from the
|
||||
## main menu. The iOS test build adds PerfTest (frame times and test buttons).
|
||||
## flat), no co-op, no Quit buttons, two thumbsticks (TouchSticks) and the action buttons
|
||||
## (TouchButtons; their Pause pauses), both taking the settings (apply_settings), and leaving
|
||||
## the app pauses. Android's back button (go_back) closes what's on top or pauses, and quits
|
||||
## from the main menu. The iOS test build adds PerfTest (frame times and test buttons).
|
||||
## Main processes while paused; the farm doesn't. Tests set save_path and settings_path
|
||||
## before adding it to the tree.
|
||||
|
||||
|
|
@ -136,11 +137,19 @@ func _ready() -> void:
|
|||
var hud_layer := farm.get_node_or_null("Hud")
|
||||
if hud_layer != null:
|
||||
hud_layer.add_child(coop_hud)
|
||||
if MobilePort.active(): # the phone's thumbsticks, over the HUD (hidden with it in the menus)
|
||||
if MobilePort.active(): # the phone's thumbsticks and buttons, over the HUD (hidden with it in the menus)
|
||||
var sticks := TouchSticks.new()
|
||||
sticks.name = "TouchSticks"
|
||||
sticks.setup(sim)
|
||||
hud_layer.add_child(sticks)
|
||||
var buttons := TouchButtons.new()
|
||||
buttons.name = "TouchButtons"
|
||||
buttons.setup(sim)
|
||||
buttons.blocked = func() -> bool: return screen != Screen.PLAYING
|
||||
buttons.pause_requested.connect(pause)
|
||||
hud_layer.add_child(buttons)
|
||||
sticks.apply_settings(settings) # (settings.apply, above, ran before they were here)
|
||||
buttons.apply_settings(settings)
|
||||
if sim.audio != null:
|
||||
sim.audio.wire_buttons($Menus)
|
||||
_menu_camera = Camera3D.new()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue