#39: tappable HUD
On phones (MobilePort.active()) the HUD's widgets take taps through small STOP hit targets (ScarecrowHud.HitTarget, at least minimum_target()), and everything beside them is still the thumbsticks': - hotbar: a tap on a main slot picks it through the number keys' path (weapon_k, applied only when combat may switch); no number keys on phones (Prompts.hotbar_key) - backpack: a tap toggles the pouch panel, a finger elsewhere (not on the panel) closes it; the panel stays inside safe_rect - tip box: an × hides tips as Backspace does (Tutorial.hide_tips) - dialogue: a Skip button on pausing conversations; a tap elsewhere advances Desktop has no targets and draws as before. Test: mobile/hud_taps_test.gd. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5392ae09af
commit
49e94874a6
7 changed files with 643 additions and 28 deletions
|
|
@ -132,3 +132,11 @@ static func sign_night() -> String:
|
|||
if touch():
|
||||
return ("At night, stab aliens with your pitchfork (%s thumb), scare them off (Fear), and pick up anything they drop. Animals roam loose until you lead them into the pen: walk up to one and it follows you. The supply shed sells a corn shooter (switch weapons on the hotbar), and more weapons arrive there over the days." % attack_side())
|
||||
return "At night, stab aliens with your pitchfork (left mouse), scare them off (Q), and pick up anything they drop. Animals roam loose until you lead them into the pen: walk up to one and it follows you. The supply shed sells a corn shooter (switch weapons with Tab or the number keys), and more weapons arrive there over the days."
|
||||
|
||||
|
||||
# --- The hotbar ---
|
||||
|
||||
## A hotbar slot's number: the key that picks its weapon (ScarecrowHud; 0: none, the off-hand's).
|
||||
## Phones pick by tapping the slot, so there it's none.
|
||||
static func hotbar_key(number: int) -> String:
|
||||
return "" if touch() or number <= 0 else str(number)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue