diff --git a/src/base-environments/volunteer_room/volunteer_room.gd b/src/base-environments/volunteer_room/volunteer_room.gd index e2a7c13..93f19dc 100644 --- a/src/base-environments/volunteer_room/volunteer_room.gd +++ b/src/base-environments/volunteer_room/volunteer_room.gd @@ -12,19 +12,25 @@ func _ready(): func get_ready() -> void: super.get_ready() - Scenes.scene_finished.connect(_on_scene_finished) - card_picker.cards_picked.connect(card_board.populate_board) save_game = State.save_game - + %TherapyVoluntaryInteractable.visible = not save_game.subway_burnout %TherapyUniInteractable.visible = save_game.subway_burnout - + + pull_save_state(State.save_game) + + card_board.initialise_from_save(save_game) card_board.board_completed.connect(func(): #TODO: hook in ending - %DoorInteractable.show() + #%DoorInteractable.show() + pass ) + card_board.closed.connect(save_room) + Scenes.scene_finished.connect(_on_scene_finished) + card_picker.cards_picked.connect(card_board.populate_board) + func start_room(): await super.start_room() diff --git a/src/dev-util/room_template.gd b/src/dev-util/room_template.gd index 5b3a148..a3153fa 100644 --- a/src/dev-util/room_template.gd +++ b/src/dev-util/room_template.gd @@ -29,6 +29,7 @@ func get_ready(): pass 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 @@ -42,6 +43,9 @@ func start_room(): func pull_save_state(_save: SaveGame) -> void: + # Interactions can this way load their correct prompts + get_tree().call_group("interactables", "pull_save_state") + # Override this function to load the state of the chapter from State.save_game restore_player_from_save(_save) diff --git a/src/logic-scenes/board/card-board.gd b/src/logic-scenes/board/card-board.gd index e1e2c93..8ecb6d2 100644 --- a/src/logic-scenes/board/card-board.gd +++ b/src/logic-scenes/board/card-board.gd @@ -69,14 +69,16 @@ func _navigate_prev(): func _ready() -> void: print("CardBoard.gd: %s._ready()" % self.name) + State.room.card_board = self + super._ready() + # HACK: Lets us debug more easily if get_parent() == get_tree().root: _debug_mode() 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 diff --git a/src/logic-scenes/playable.gd b/src/logic-scenes/playable.gd index f8bd309..c464fa4 100644 --- a/src/logic-scenes/playable.gd +++ b/src/logic-scenes/playable.gd @@ -1,11 +1,8 @@ -extends Control +extends Control class_name Playable func _ready() -> void: hide() - if not Main.normal_boot: - play.call_deferred() - ## Awaitable that encapsulates the core interaction with this Playable func play() -> void: @@ -24,7 +21,7 @@ func appear(): var tween := create_tween().set_ease(Tween.EASE_IN) tween.tween_property(self, "modulate", Color.WHITE, 0.3) await tween.finished - + func vanish(): var tween := create_tween().set_ease(Tween.EASE_OUT) tween.tween_property(self, "modulate", TRANSPARENT_BLACK, 0.3)