diff --git a/src/dev-util/room_template.gd b/src/dev-util/room_template.gd index cb51392..1004914 100644 --- a/src/dev-util/room_template.gd +++ b/src/dev-util/room_template.gd @@ -29,6 +29,8 @@ func get_ready(): for i in range(20): await get_tree().process_frame func play() -> String: + for i in range(20): + await get_tree().process_frame await get_ready() await start_room() var next_room : StringName = await proceed diff --git a/src/internationalisation.de.translation b/src/internationalisation.de.translation index d907a3e..9b81b50 100644 Binary files a/src/internationalisation.de.translation and b/src/internationalisation.de.translation differ diff --git a/src/internationalisation.en.translation b/src/internationalisation.en.translation index 97ff273..0f7c76d 100644 Binary files a/src/internationalisation.en.translation and b/src/internationalisation.en.translation differ diff --git a/src/internationalisation.es.translation b/src/internationalisation.es.translation index 61de06a..8e10353 100644 Binary files a/src/internationalisation.es.translation and b/src/internationalisation.es.translation differ diff --git a/src/internationalisation.ja.translation b/src/internationalisation.ja.translation index b90cb06..1594e28 100644 Binary files a/src/internationalisation.ja.translation and b/src/internationalisation.ja.translation differ diff --git a/src/logic-scenes/board/board.gd b/src/logic-scenes/board/board.gd index 79f02b1..01190b0 100644 --- a/src/logic-scenes/board/board.gd +++ b/src/logic-scenes/board/board.gd @@ -16,9 +16,6 @@ func _ready(): elif item is StickyNote: spawn_sticky_note((item as StickyNote).duplicate()) -func _process(delta: float): - pass - func spawn_card(card: Card): $cards.add_child(card) diff --git a/src/logic-scenes/board/card-board.gd b/src/logic-scenes/board/card-board.gd index e901a93..38119da 100644 --- a/src/logic-scenes/board/card-board.gd +++ b/src/logic-scenes/board/card-board.gd @@ -79,6 +79,7 @@ func _ready() -> void: return print("Board Ready!", self, "room", State.room) + State.room.card_board = self ## frame rate independent FIR smoothing filter used for small or dynamic card adjustments @@ -111,6 +112,7 @@ func _process(delta: float): else: # do adjustment with FIR filter note.position = _smooth(note.position, note.home, delta) + note.z_index = 0 @@ -292,13 +294,11 @@ var complete: bool = false func give_lore_feedback(): var fitting_card_count: int = 0 - var total_card_count: int = 0 + var total_card_count: int = len(cards) - for child in dropzone.get_children(): - if child is Card: - if child.has_note_attached(): - fitting_card_count += int(child.card_id == child.get_attached_note().parent_id) - total_card_count += 1 + for child in cards: + if child.has_note_attached(): + fitting_card_count += int(child.card_id == child.get_attached_note().parent_id) if float(fitting_card_count) / float(total_card_count) < 0.2: instructions.text = "You can move on, but you may not have understood Lisa." diff --git a/src/logic-scenes/board/card.gd b/src/logic-scenes/board/card.gd index 2820c56..9564891 100644 --- a/src/logic-scenes/board/card.gd +++ b/src/logic-scenes/board/card.gd @@ -1,7 +1,7 @@ extends Draggable class_name Card -var card_id +var card_id : StringName enum burned { NOT, diff --git a/src/logic-scenes/board/draggable.gd b/src/logic-scenes/board/draggable.gd index 8ae8a04..1c44a94 100644 --- a/src/logic-scenes/board/draggable.gd +++ b/src/logic-scenes/board/draggable.gd @@ -70,6 +70,7 @@ var tween : Tween = null func animate_home() -> void: + z_index = 50 if tween: tween.kill() tween = create_tween().set_ease(Tween.EASE_IN_OUT).set_trans(Tween.TRANS_QUART) tween.tween_property(self, "position", home, 0.5) @@ -114,6 +115,7 @@ func start_drag(mouse_offset: Vector2) -> void: _drag_start_position = global_position _mouse_drag_offset = mouse_offset _drag_source = get_parent() + z_index = 60 is_dragged = true ## Updates position during drag (call from _process or manual update) @@ -130,6 +132,7 @@ func find_drop_target() -> Node: ## End drag operation and return the node we want to be accepted by (if any) func end_drag() -> Node: + z_index = 0 is_dragged = false _drag_source = null return null diff --git a/src/logic-scenes/board/physics-board.tscn b/src/logic-scenes/board/physics-board.tscn index d19e72b..cb0adb9 100644 --- a/src/logic-scenes/board/physics-board.tscn +++ b/src/logic-scenes/board/physics-board.tscn @@ -177,6 +177,7 @@ layout_mode = 2 mouse_filter = 1 [node name="instructions_panel" type="PanelContainer" parent="."] +z_index = 100 layout_mode = 2 size_flags_horizontal = 4 size_flags_vertical = 0 diff --git a/src/logic-scenes/board/sticky-note.gd b/src/logic-scenes/board/sticky-note.gd index d24f8d3..25c7f77 100644 --- a/src/logic-scenes/board/sticky-note.gd +++ b/src/logic-scenes/board/sticky-note.gd @@ -2,7 +2,7 @@ extends Draggable class_name StickyNote var sticky_id -var parent_id +var parent_id : StringName var sibling: StickyNote var shift_tween: Tween diff --git a/src/logic-scenes/card_picker/card_picker.gd b/src/logic-scenes/card_picker/card_picker.gd index 038ed96..27842fc 100644 --- a/src/logic-scenes/card_picker/card_picker.gd +++ b/src/logic-scenes/card_picker/card_picker.gd @@ -230,4 +230,3 @@ func pick_cards(id: Scenes.id): await cards_picked hide() - diff --git a/src/logic-scenes/interactable/interactable.gd b/src/logic-scenes/interactable/interactable.gd index c82d34f..372bebe 100644 --- a/src/logic-scenes/interactable/interactable.gd +++ b/src/logic-scenes/interactable/interactable.gd @@ -30,6 +30,11 @@ var tween: Tween = null func _ready() -> void: assert(note and frame and canvas_layer, "Interactable must have views and frame attached") + + if interaction: + playable = interaction.instantiate() as Control + canvas_layer.add_child(playable) + view.scale = Vector3.ZERO frame.modulate.a = 0.0 light.visible = false @@ -39,9 +44,6 @@ func _ready() -> void: ## To be called by room func pull_save_state() -> void: - if interaction: - playable = interaction.instantiate() as Control - canvas_layer.add_child(playable) _update_caption() # Check if this scene was already completed (for re-entering rooms) if playable is StoryPlayable: diff --git a/src/logic-scenes/playable.gd b/src/logic-scenes/playable.gd index c464fa4..3fac964 100644 --- a/src/logic-scenes/playable.gd +++ b/src/logic-scenes/playable.gd @@ -3,6 +3,7 @@ class_name Playable func _ready() -> void: hide() + ## Awaitable that encapsulates the core interaction with this Playable func play() -> void: