Compare commits
4 Commits
7c8428af01
...
071c0de5a7
| Author | SHA1 | Date |
|---|---|---|
|
|
071c0de5a7 | |
|
|
a9af1e5995 | |
|
|
cc73e1e4b6 | |
|
|
cdcf6609d7 |
|
|
@ -10,21 +10,26 @@ func _ready():
|
||||||
|
|
||||||
|
|
||||||
func get_ready() -> void:
|
func get_ready() -> void:
|
||||||
super.get_ready()
|
await super.get_ready()
|
||||||
|
|
||||||
|
# Interactions can this way load their correct prompts
|
||||||
|
get_tree().call_group("interactables", "pull_save_state")
|
||||||
|
|
||||||
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
|
%TherapyVoluntaryInteractable.visible = not save_game.subway_burnout
|
||||||
%TherapyUniInteractable.visible = save_game.subway_burnout
|
%TherapyUniInteractable.visible = save_game.subway_burnout
|
||||||
|
|
||||||
card_board.initialise_from_save(save_game)
|
pull_save_state(State.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()
|
||||||
|
|
|
||||||
|
|
@ -40,20 +40,18 @@ func _play_intro_scene() -> void:
|
||||||
await intro.interact()
|
await intro.interact()
|
||||||
|
|
||||||
|
|
||||||
func get_ready():
|
func get_ready() -> void:
|
||||||
super.get_ready()
|
await super.get_ready()
|
||||||
prints("indeed")
|
|
||||||
Scenes.scene_finished.connect(_on_scene_finished)
|
|
||||||
|
|
||||||
|
pull_save_state(State.save_game)
|
||||||
|
|
||||||
|
card_board.closed.connect(save_room)
|
||||||
card_board.board_completed.connect(func():
|
card_board.board_completed.connect(func():
|
||||||
%DoorInteractable.show()
|
%DoorInteractable.show()
|
||||||
save_game.childhood_board_complete = true
|
save_game.childhood_board_complete = true
|
||||||
)
|
)
|
||||||
|
|
||||||
pull_save_state(State.save_game)
|
Scenes.scene_finished.connect(_on_scene_finished)
|
||||||
|
|
||||||
card_board.closed.connect(save_room)
|
|
||||||
|
|
||||||
card_picker.cards_picked.connect(card_board.populate_board)
|
card_picker.cards_picked.connect(card_board.populate_board)
|
||||||
|
|
||||||
ui.hide()
|
ui.hide()
|
||||||
|
|
@ -65,15 +63,16 @@ func pull_save_state(save: SaveGame) -> void:
|
||||||
save_game = save
|
save_game = save
|
||||||
save_game.current_room = id
|
save_game.current_room = id
|
||||||
|
|
||||||
# Load board state from save first, before overwriting it
|
|
||||||
card_board.initialise_from_save(save_game)
|
|
||||||
|
|
||||||
Scenes.started_sequences = save_game.mementos_complete
|
|
||||||
Scenes.completed_sequences = save_game.mementos_complete
|
|
||||||
|
|
||||||
# Interactions can this way load their correct prompts
|
# Interactions can this way load their correct prompts
|
||||||
get_tree().call_group("interactables", "pull_save_state")
|
get_tree().call_group("interactables", "pull_save_state")
|
||||||
|
|
||||||
|
# Load board state from save first, before overwriting it
|
||||||
|
card_board.initialise_from_save(save_game)
|
||||||
|
|
||||||
|
# TODO: These should be deprecated, SaveGame is our source of truth
|
||||||
|
Scenes.started_sequences = save_game.mementos_complete
|
||||||
|
Scenes.completed_sequences = save_game.mementos_complete
|
||||||
|
|
||||||
# Call parent to restore player position
|
# Call parent to restore player position
|
||||||
super.pull_save_state(save)
|
super.pull_save_state(save)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,8 @@ var id: State.rooms = State.rooms.NULL
|
||||||
@onready var scene_player : AnimationPlayer = %SceneAnimationPlayer
|
@onready var scene_player : AnimationPlayer = %SceneAnimationPlayer
|
||||||
@onready var card_board : CardBoard # Optional Board, if present - set by the board in its own _ready()
|
@onready var card_board : CardBoard # Optional Board, if present - set by the board in its own _ready()
|
||||||
|
|
||||||
var save_game:SaveGame = null
|
var save_game : SaveGame:
|
||||||
|
get: return State.save_game
|
||||||
|
|
||||||
signal proceed(next_scene_path: String)
|
signal proceed(next_scene_path: String)
|
||||||
|
|
||||||
|
|
@ -17,7 +18,6 @@ func _ready() -> void:
|
||||||
push_warning("Room initialised without a SaveGame. Creating proxy save.")
|
push_warning("Room initialised without a SaveGame. Creating proxy save.")
|
||||||
State.save_game = ResourceLoader.load("res://dev-util/debug_save.tres")
|
State.save_game = ResourceLoader.load("res://dev-util/debug_save.tres")
|
||||||
|
|
||||||
save_game = State.save_game
|
|
||||||
|
|
||||||
if not Main.normal_boot:
|
if not Main.normal_boot:
|
||||||
push_warning("------- DEBUG MODE --------")
|
push_warning("------- DEBUG MODE --------")
|
||||||
|
|
@ -26,7 +26,7 @@ func _ready() -> void:
|
||||||
|
|
||||||
func get_ready():
|
func get_ready():
|
||||||
prints("----------", "GET_READY", self.name, "--------------")
|
prints("----------", "GET_READY", self.name, "--------------")
|
||||||
pass
|
for i in range(20): await get_tree().process_frame
|
||||||
|
|
||||||
func play() -> String:
|
func play() -> String:
|
||||||
for i in range(20):
|
for i in range(20):
|
||||||
|
|
|
||||||
|
|
@ -69,8 +69,15 @@ 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
|
||||||
|
if get_parent() == get_tree().root:
|
||||||
|
_debug_mode()
|
||||||
|
return
|
||||||
|
|
||||||
print("Board Ready!", self, "room", State.room)
|
print("Board Ready!", self, "room", State.room)
|
||||||
State.room.card_board = self
|
State.room.card_board = self
|
||||||
|
|
||||||
|
|
@ -471,7 +478,7 @@ func initialise_from_save(savegame: SaveGame) -> void:
|
||||||
print(" Card '%s' at %s" % [card.name, card.position])
|
print(" Card '%s' at %s" % [card.name, card.position])
|
||||||
else:
|
else:
|
||||||
card.position = _generate_random_position()
|
card.position = _generate_random_position()
|
||||||
push_warning(" Card '%s' - no saved position, using random" % card.name)
|
print(" Card '%s' - no saved position, using random" % card.name)
|
||||||
|
|
||||||
# Attach sticky notes to cards or position them loose
|
# Attach sticky notes to cards or position them loose
|
||||||
for sticky: StickyNote in notes:
|
for sticky: StickyNote in notes:
|
||||||
|
|
@ -490,7 +497,7 @@ func initialise_from_save(savegame: SaveGame) -> void:
|
||||||
else:
|
else:
|
||||||
# Fallback to center of board
|
# Fallback to center of board
|
||||||
sticky.position = position + size / 2.0
|
sticky.position = position + size / 2.0
|
||||||
push_warning(" Sticky '%s' - no saved position, using center" % sticky.name)
|
print(" Sticky '%s' - no saved position, using center" % sticky.name)
|
||||||
|
|
||||||
|
|
||||||
# Re-sort by positions for correct z-ordering
|
# Re-sort by positions for correct z-ordering
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,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