fix: interactable sequencing
This commit is contained in:
parent
53ace145aa
commit
1027e5f20a
|
|
@ -94,20 +94,18 @@ func _input(event: InputEvent) -> void:
|
||||||
|
|
||||||
var clicked : bool = (event.is_action_pressed("ui_accept")) or (event is InputEventMouseButton and event.is_pressed())
|
var clicked : bool = (event.is_action_pressed("ui_accept")) or (event is InputEventMouseButton and event.is_pressed())
|
||||||
if hover and shown and clicked:
|
if hover and shown and clicked:
|
||||||
collect_memento()
|
interact()
|
||||||
|
|
||||||
|
|
||||||
func play_story() -> void:
|
func play_story() -> void:
|
||||||
|
# Check if this is a repeat playthrough
|
||||||
var repeat := collected
|
var repeat := collected
|
||||||
|
|
||||||
collected = true
|
collected = true
|
||||||
canvas_layer.show()
|
canvas_layer.show()
|
||||||
|
|
||||||
# Check if this is a repeat playthrough
|
|
||||||
var is_repeating := Scenes.is_sequence_repeating(interaction_ui.scene_id)
|
|
||||||
|
|
||||||
# Allow room to prepare for scene (e.g., play animations)
|
# Allow room to prepare for scene (e.g., play animations)
|
||||||
if State.room and State.room.has_method("prepare_scene_start"):
|
await State.room.prepare_scene_start(interaction_ui.scene_id, repeat)
|
||||||
await State.room.prepare_scene_start(interaction_ui.scene_id, is_repeating)
|
|
||||||
|
|
||||||
Scenes.begin_sequence(interaction_ui.scene_id)
|
Scenes.begin_sequence(interaction_ui.scene_id)
|
||||||
|
|
||||||
|
|
@ -119,12 +117,11 @@ func play_story() -> void:
|
||||||
var picker := State.room.get_node("%Picker") as CardPicker
|
var picker := State.room.get_node("%Picker") as CardPicker
|
||||||
await picker.pick_cards(interaction_ui.scene_id)
|
await picker.pick_cards(interaction_ui.scene_id)
|
||||||
|
|
||||||
|
Scenes.end_sequence(interaction_ui.scene_id) # todo: maybe later?
|
||||||
|
|
||||||
# Hide the CanvasLayer when done
|
# Hide the CanvasLayer when done
|
||||||
canvas_layer.hide()
|
canvas_layer.hide()
|
||||||
|
|
||||||
Scenes.end_sequence(interaction_ui.scene_id) # todo: maybe later?
|
|
||||||
|
|
||||||
Scenes.player_enable.emit(true)
|
Scenes.player_enable.emit(true)
|
||||||
expand()
|
expand()
|
||||||
|
|
||||||
|
|
@ -141,11 +138,10 @@ func play_board() -> void:
|
||||||
expand()
|
expand()
|
||||||
|
|
||||||
|
|
||||||
func collect_memento() -> void:
|
func interact() -> void:
|
||||||
shown = false
|
|
||||||
Scenes.player_enable.emit(false)
|
Scenes.player_enable.emit(false)
|
||||||
|
shown = false
|
||||||
await collapse()
|
await collapse()
|
||||||
collected = true
|
|
||||||
|
|
||||||
# Hide mouse and collapse other interactables BEFORE showing canvas
|
# Hide mouse and collapse other interactables BEFORE showing canvas
|
||||||
get_tree().call_group("interactables", "collapse")
|
get_tree().call_group("interactables", "collapse")
|
||||||
|
|
@ -160,7 +156,8 @@ func collect_memento() -> void:
|
||||||
await play_board()
|
await play_board()
|
||||||
|
|
||||||
canvas_layer.hide()
|
canvas_layer.hide()
|
||||||
active = true
|
collected = true
|
||||||
|
Scenes.player_enable.emit(true)
|
||||||
|
|
||||||
|
|
||||||
## Updates caption label based on the instantiated interaction_ui
|
## Updates caption label based on the instantiated interaction_ui
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue