Polish dialog and intro transitions

This commit is contained in:
Loïc Wisniewski 2026-09-02 20:18:44 +02:00
commit d413d1da9f
7 changed files with 228 additions and 4 deletions

View file

@ -40,6 +40,9 @@ var knob_pos: Vector2 = Vector2.ZERO
func _ready() -> void:
# Dialogs release every spring-loaded stick through one compositional
# contract, without NarrationBanner knowing scene paths or joystick roles.
add_to_group("touch_joysticks")
resized.connect(_relayout)
_relayout()
@ -79,6 +82,15 @@ func handle_touch(event: InputEventScreenTouch) -> bool:
if event.index != active_touch_index:
return false
release_input()
return true
# Returns this spring-loaded control to its neutral state. Public and
# idempotent so a dialog can safely release movement and fire sticks before
# pausing their controllers (#182), even when only one is currently held.
func release_input() -> void:
var was_active: bool = is_active() or direction != Vector2.ZERO
active_touch_index = -1
# Back to the middle of the rect, BASE included. This used to reset the
# knob onto base_pos and leave the base wherever the finger had landed, so
@ -88,9 +100,9 @@ func handle_touch(event: InputEventScreenTouch) -> bool:
knob_pos = base_pos
direction = Vector2.ZERO
queue_redraw()
direction_changed.emit(direction)
released.emit()
return true
if was_active:
direction_changed.emit(direction)
released.emit()
func handle_drag(event: InputEventScreenDrag) -> bool: