fix: improper order of operations / delegation for cardboard caused it to be not loaded
This commit is contained in:
parent
80eb4a727f
commit
cdcf6609d7
|
|
@ -12,19 +12,25 @@ func _ready():
|
||||||
func get_ready() -> void:
|
func get_ready() -> void:
|
||||||
super.get_ready()
|
super.get_ready()
|
||||||
|
|
||||||
Scenes.scene_finished.connect(_on_scene_finished)
|
|
||||||
card_picker.cards_picked.connect(card_board.populate_board)
|
|
||||||
save_game = State.save_game
|
save_game = State.save_game
|
||||||
|
|
||||||
%TherapyVoluntaryInteractable.visible = not save_game.subway_burnout
|
%TherapyVoluntaryInteractable.visible = not save_game.subway_burnout
|
||||||
%TherapyUniInteractable.visible = 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.initialise_from_save(save_game)
|
||||||
card_board.board_completed.connect(func():
|
card_board.board_completed.connect(func():
|
||||||
#TODO: hook in ending
|
#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():
|
func start_room():
|
||||||
await super.start_room()
|
await super.start_room()
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ func get_ready():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
func play() -> String:
|
func play() -> String:
|
||||||
|
for i in range(20): await get_tree().process_frame
|
||||||
await get_ready()
|
await get_ready()
|
||||||
await start_room()
|
await start_room()
|
||||||
var next_room : StringName = await proceed
|
var next_room : StringName = await proceed
|
||||||
|
|
@ -42,6 +43,9 @@ func start_room():
|
||||||
|
|
||||||
|
|
||||||
func pull_save_state(_save: SaveGame) -> void:
|
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
|
# Override this function to load the state of the chapter from State.save_game
|
||||||
restore_player_from_save(_save)
|
restore_player_from_save(_save)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,14 +69,16 @@ func _navigate_prev():
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
print("CardBoard.gd: %s._ready()" % self.name)
|
print("CardBoard.gd: %s._ready()" % self.name)
|
||||||
|
State.room.card_board = self
|
||||||
|
|
||||||
super._ready()
|
super._ready()
|
||||||
|
|
||||||
# HACK: Lets us debug more easily
|
# HACK: Lets us debug more easily
|
||||||
if get_parent() == get_tree().root:
|
if get_parent() == get_tree().root:
|
||||||
_debug_mode()
|
_debug_mode()
|
||||||
return
|
return
|
||||||
|
|
||||||
print("Board Ready!", self, "room", State.room)
|
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
|
## frame rate independent FIR smoothing filter used for small or dynamic card adjustments
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,8 @@
|
||||||
extends Control
|
extends Control
|
||||||
class_name Playable
|
class_name Playable
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
hide()
|
hide()
|
||||||
if not Main.normal_boot:
|
|
||||||
play.call_deferred()
|
|
||||||
|
|
||||||
|
|
||||||
## Awaitable that encapsulates the core interaction with this Playable
|
## Awaitable that encapsulates the core interaction with this Playable
|
||||||
func play() -> void:
|
func play() -> void:
|
||||||
|
|
@ -24,7 +21,7 @@ func appear():
|
||||||
var tween := create_tween().set_ease(Tween.EASE_IN)
|
var tween := create_tween().set_ease(Tween.EASE_IN)
|
||||||
tween.tween_property(self, "modulate", Color.WHITE, 0.3)
|
tween.tween_property(self, "modulate", Color.WHITE, 0.3)
|
||||||
await tween.finished
|
await tween.finished
|
||||||
|
|
||||||
func vanish():
|
func vanish():
|
||||||
var tween := create_tween().set_ease(Tween.EASE_OUT)
|
var tween := create_tween().set_ease(Tween.EASE_OUT)
|
||||||
tween.tween_property(self, "modulate", TRANSPARENT_BLACK, 0.3)
|
tween.tween_property(self, "modulate", TRANSPARENT_BLACK, 0.3)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue