2024-10-06 09:38:15 +00:00
|
|
|
class_name RoomTemplate extends Node3D
|
|
|
|
|
|
2024-10-18 16:10:51 +00:00
|
|
|
var initialised: bool = false
|
2025-12-12 23:22:21 +00:00
|
|
|
var id: State.rooms = State.rooms.NULL
|
2024-10-18 16:10:51 +00:00
|
|
|
|
|
|
|
|
var has_stage: bool:
|
|
|
|
|
set(value):
|
|
|
|
|
has_stage = value
|
|
|
|
|
if has_stage and not initialised:
|
|
|
|
|
start_room()
|
|
|
|
|
|
|
|
|
|
|
2025-12-13 10:06:15 +00:00
|
|
|
var save_game:SaveGame = null
|
2024-10-06 09:38:15 +00:00
|
|
|
|
2025-12-12 23:22:21 +00:00
|
|
|
signal proceed(next_scene_path: String)
|
|
|
|
|
|
|
|
|
|
func _ready() -> void:
|
|
|
|
|
State.room = self
|
|
|
|
|
State.current_room = id
|
|
|
|
|
|
|
|
|
|
func load():
|
|
|
|
|
# Override this function to load the state of the chapter from State.save_game
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
func play() -> String:
|
|
|
|
|
get_ready()
|
|
|
|
|
start_room()
|
|
|
|
|
return await proceed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func get_ready():
|
|
|
|
|
pass
|
|
|
|
|
|
2024-10-18 16:10:51 +00:00
|
|
|
func start_room():
|
|
|
|
|
pass
|
|
|
|
|
|
2024-10-06 09:38:15 +00:00
|
|
|
func pull_save_state(save: SaveGame) -> void:
|
|
|
|
|
pass
|
2025-12-08 09:43:02 +00:00
|
|
|
|
2024-10-06 09:38:15 +00:00
|
|
|
func save_room():
|
|
|
|
|
pull_save_state(save_game)
|
2025-03-25 21:34:13 +00:00
|
|
|
save_game.save_to_file(get_tree().root.get_texture())
|
2025-06-03 21:17:29 +00:00
|
|
|
|
|
|
|
|
func prepare_transition():
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
func unload():
|
|
|
|
|
pass
|