frame-of-mind/src/main.gd

44 lines
1.3 KiB
GDScript3
Raw Normal View History

2023-12-02 16:37:42 +00:00
extends Node3D
@export_file(".tscn") var youth_room_path: String
@export_file(".tscn") var voluntary_room: String
@export_file(".tscn") var study_room: String
@onready var menu_animation: AnimationTree = %MenuAnimationTree
@onready var focus_forward = %"Main Menu"
var in_game = false
var current_loaded_room: Node3D
var currently_loading_room: String = "":
set(path):
if path != "":
ResourceLoader.load_threaded_request(path, "PackedScene")
menu_animation["parameters/conditions/loading_done"] = false
menu_animation["parameters/conditions/load_save"] = true
currently_loading_room = path
else:
menu_animation["parameters/conditions/loading_done"] = true
menu_animation["parameters/conditions/load_save"] = false
2023-12-02 16:37:42 +00:00
# Called when the node enters the scene tree for the first time.
func _ready():
currently_loading_room = youth_room_path
func _process(delta: float) -> void:
if currently_loading_room != "":
var progress:Array
if ResourceLoader.load_threaded_get_status(youth_room_path, progress) == 3:
current_loaded_room = ResourceLoader.load_threaded_get(youth_room_path).instantiate()
add_child(current_loaded_room)
move_child(current_loaded_room, 0)
currently_loading_room = ""
2023-12-02 16:37:42 +00:00
func debug_youth():
2024-09-15 09:30:31 +00:00
get_child(1).hide()
get_child(2).hide()
get_child(3).hide()
get_child(0).get_ready()
get_child(0).start()