From a2e2e56afc636b2d38a6bd8378f85f32f8e00498 Mon Sep 17 00:00:00 2001 From: April John Date: Sat, 2 Dec 2023 17:37:42 +0100 Subject: [PATCH] [feat] debug youth room --- .../youth_room/room_handle.gd | 18 +++++++++++++----- src/disclaimer.tscn | 6 +++--- src/main.gd | 17 +++++++++++++++++ src/main.tscn | 4 +++- 4 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 src/main.gd diff --git a/src/base-environments/youth_room/room_handle.gd b/src/base-environments/youth_room/room_handle.gd index 19405ab..309c8ca 100644 --- a/src/base-environments/youth_room/room_handle.gd +++ b/src/base-environments/youth_room/room_handle.gd @@ -31,9 +31,17 @@ func _update_scene(new_mode) -> int: return new_mode +func is_self(node: Node) -> bool: + return self == node + func get_ready(): - self.show() - $sfx/distant_rain.play() - $"sfx/rain on window".play() - await get_tree().create_timer(0.1).timeout - $logic/UI/board.hide() + self.show() + $sfx/distant_rain.play() + $"sfx/rain on window".play() + await get_tree().create_timer(0.1).timeout + $logic/UI/board.hide() + +func _ready(): + if get_parent() == get_tree().root: + get_ready() + start() diff --git a/src/disclaimer.tscn b/src/disclaimer.tscn index bdefa7a..64a15dd 100644 --- a/src/disclaimer.tscn +++ b/src/disclaimer.tscn @@ -10,11 +10,11 @@ script/source = "extends Panel signal on_read func _ready(): - $childhood/PanelContainer/VBoxContainer/Start.grab_focus() + $childhood/PanelContainer/VBoxContainer/Start.grab_focus() func _on_start_pressed(): - emit_signal(\"on_read\") - hide() + emit_signal(\"on_read\") + hide() " [sub_resource type="GDScript" id="GDScript_tb2ju"] diff --git a/src/main.gd b/src/main.gd new file mode 100644 index 0000000..f35e015 --- /dev/null +++ b/src/main.gd @@ -0,0 +1,17 @@ +extends Node3D + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + +func debug_youth(): + get_child(1).hide() + get_child(2).hide() + get_child(3).hide() + get_child(0).get_ready() + get_child(0).start() + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass diff --git a/src/main.tscn b/src/main.tscn index 47bd02a..b547ef2 100644 --- a/src/main.tscn +++ b/src/main.tscn @@ -1,5 +1,6 @@ -[gd_scene load_steps=9 format=3 uid="uid://befxf8uruwnrl"] +[gd_scene load_steps=10 format=3 uid="uid://befxf8uruwnrl"] +[ext_resource type="Script" path="res://main.gd" id="1_rqkns"] [ext_resource type="PackedScene" uid="uid://gldtxysavetf" path="res://logic-scenes/startup/startup.tscn" id="1_v5rpm"] [ext_resource type="PackedScene" uid="uid://b3b0gyvklqn50" path="res://base-environments/youth_room/youth_room.tscn" id="2_23ia3"] [ext_resource type="Theme" uid="uid://b056fn288p8ha" path="res://logic-scenes/themes/messy.theme" id="3_8hrj7"] @@ -17,6 +18,7 @@ func _process(_delta): " [node name="root" type="Node3D"] +script = ExtResource("1_rqkns") [node name="youth room" parent="." instance=ExtResource("2_23ia3")]