rework sequence handling

This commit is contained in:
betalars 2025-02-06 18:55:05 +01:00
parent eca8505d4b
commit 85125fb32d
15 changed files with 1070 additions and 223 deletions

View File

@ -20,9 +20,10 @@ func start_room():
comic_memento.collected = save_game.mementos_complete && 1 >> Scenes.id.YOUTH_VOICE_TRAINING > 0
ceiling_memento.collected = save_game.mementos_complete && 1 >> Scenes.id.YOUTH_DRAEVEN > 0
State.pass_stage_to($logic/PlayerController)
$logic/PlayerController.process_mode = Node.PROCESS_MODE_INHERIT
ini_room.emit()
Scenes.start_sequence(Scenes.id.YOUTH_DRAEVEN)
State.queue_for_stage(%PlayerController)
func get_ready():
@ -33,6 +34,8 @@ func get_ready():
$logic/UI/board.hide()
func _ready():
Scenes.scene_finished.connect(_on_scene_finished)
if get_parent() == get_tree().root:
get_ready()
start_room()
@ -41,7 +44,7 @@ func _ready():
func pull_save_state(save: SaveGame) -> void:
save.board_state = card_board.get_save_dict()
func _on_scene_finished(id: int):
func _on_scene_finished(id: int, _repeat:bool):
save_game.mementos_complete &= 1 << id
save_room()

View File

@ -1,12 +1,12 @@
[gd_scene load_steps=17 format=3 uid="uid://c3l8tm8ku50vt"]
[gd_scene load_steps=19 format=3 uid="uid://c3l8tm8ku50vt"]
[ext_resource type="Script" path="res://base-environments/youth_room/scnees/scene_player.gd" id="1_40hhx"]
[ext_resource type="Texture2D" uid="uid://d0ucjqi8tx6vt" path="res://import/interface-elements/frame.png" id="1_bkq30"]
[ext_resource type="ArrayMesh" uid="uid://bfc3d4g40n0wy" path="res://logic-scenes/collectable/import/old-mask.res" id="2_jrxfv"]
[ext_resource type="Texture2D" uid="uid://bwicl5q0lw06q" path="res://import/interface-elements/bottom.png" id="3_o63m7"]
[ext_resource type="PackedScene" uid="uid://dvwuhobhka78d" path="res://logic-scenes/misc/skip_control.tscn" id="4_q0fee"]
[ext_resource type="AudioStream" uid="uid://cvlqvlrc6lqru" path="res://base-environments/youth_room/audio/draven-de.wav" id="6_cfqix"]
[ext_resource type="AudioStream" uid="uid://c4clagpd3ril0" path="res://base-environments/youth_room/audio/Ambient 5.ogg" id="7_1v51b"]
[ext_resource type="AudioStream" uid="uid://b3cw0e41rjggo" path="res://base-environments/youth_room/audio/childhood_de.wav" id="6_wyhdp"]
[ext_resource type="AudioStream" uid="uid://bwh60165c3saj" path="res://base-environments/youth_room/audio/lisa_youth_voice.ogg" id="7_w01wh"]
[sub_resource type="ViewportTexture" id="ViewportTexture_2cudi"]
viewport_path = NodePath("PanelContainer/StartFrame/TextureRect/SubViewport")
@ -122,10 +122,22 @@ tracks/4/keys = {
"update": 1,
"values": [true]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("../../..:modulate")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
[sub_resource type="Animation" id="Animation_bgeog"]
resource_name = "de"
length = 160.0
length = 94.0
tracks/0/type = "audio"
tracks/0/imported = false
tracks/0/enabled = true
@ -135,110 +147,282 @@ tracks/0/loop_wrap = true
tracks/0/keys = {
"clips": [{
"end_offset": 0.0,
"start_offset": 1.45,
"stream": ExtResource("6_cfqix")
"start_offset": 0.0,
"stream": ExtResource("6_wyhdp")
}],
"times": PackedFloat32Array(1.9)
"times": PackedFloat32Array(1.3)
}
tracks/0/use_blend = true
tracks/1/type = "audio"
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("%AnimationPlayer/Music")
tracks/1/path = NodePath("../../..:progress")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"clips": [{
"end_offset": 0.0,
"start_offset": 1.13,
"stream": ExtResource("7_1v51b")
}],
"times": PackedFloat32Array(0.133333)
"times": PackedFloat32Array(0, 1.66667, 6.13333, 7.43333, 13.5, 14.5667, 19.1333, 19.5333, 22.7333, 25.6333, 27.3333, 28.8, 32.7333, 34.8667, 36.6275, 37.7667, 46.2333, 47.5667, 49.4667, 50.8333, 54.6667, 56.3, 60.4667, 61.8333, 68.2028, 69.5667, 72.4, 74.5, 78.493, 80.2, 84.033, 85.3, 88.0997, 89.6667),
"transitions": PackedFloat32Array(1, 0.482968, 1, 0.482968, 1, 0.482968, 1, 0.482968, 1, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968),
"update": 0,
"values": [0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 9.0, 9.0, 10.0, 10.0, 11.0, 11.0, 12.0, 12.0, 13.0, 13.0, 14.0, 14.0, 15.0, 15.0, 16.0, 16.0, 17.0, 17.0]
}
tracks/1/use_blend = true
tracks/2/type = "value"
tracks/2/type = "method"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("../../..:progress")
tracks/2/path = NodePath("../../..")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 1.66667, 6.13333, 7.76667, 16.3, 19.0333, 26.7, 28.2, 34.9333, 36.7, 40.5, 41.9667, 44.6, 45.2, 49.2667, 50.4059, 55.2667, 56.0667, 58.8333, 60.8, 63.6667, 64.4667, 70.3058, 72.8, 82.2667, 83.8333, 90.0028, 91.0667, 97.6333, 99.7667, 106.526, 108.233, 117.933, 119.2, 121.633, 123.2, 132.033),
"transitions": PackedFloat32Array(1, 0.482968, 1, 0.482968, 1, 0.482968, 1, 0.482968, 1, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968),
"update": 0,
"values": [0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0, 9.0, 9.0, 10.0, 10.0, 11.0, 11.0, 12.0, 12.0, 13.0, 13.0, 14.0, 14.0, 15.0, 15.0, 16.0, 16.0, 17.0, 17.0, 18.0]
}
tracks/3/type = "method"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("../../..")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(97.7333),
"transitions": PackedFloat32Array(1),
"times": PackedFloat32Array(13.3333, 24.7667, 49.7, 68.8667, 85.5, 91.3333),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
"values": [{
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"_on_text_finished"
}]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("..:custom_minimum_size")
tracks/4/interp = 2
tracks/4/loop_wrap = true
tracks/4/keys = {
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("..:custom_minimum_size")
tracks/3/interp = 2
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.7),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(900, 800), Vector2(900, 900)]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath(".:rotation")
tracks/5/interp = 2
tracks/5/loop_wrap = true
tracks/5/keys = {
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath(".:rotation")
tracks/4/interp = 2
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0, 1.8),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.174533, 0.349066]
}
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("../..:modulate")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("../..:modulate")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0, 0.733333),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("../../..:visible")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("../../..:visible")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("../../..:modulate")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
[sub_resource type="Animation" id="Animation_7qabw"]
resource_name = "en"
length = 89.0
tracks/0/type = "audio"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("%AnimationPlayer/Text")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"clips": [{
"end_offset": 200.63,
"start_offset": 96.4197,
"stream": ExtResource("7_w01wh")
}],
"times": PackedFloat32Array(1.4)
}
tracks/0/use_blend = true
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("../../..:progress")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 1.66667, 6.26666, 7.56667, 17.4, 18.4667, 21.8667, 22.8, 28.6, 29.9333, 32.3, 32.8, 36.2667, 38.2333, 40.1608, 40.6, 50.9667, 51.6333, 55.0333, 56.4, 58.8333, 59.7, 61.5667, 62.9333, 67.4028, 68.7667, 71.8333, 72.8333, 75.293, 77, 80.7663, 82.0333, 88),
"transitions": PackedFloat32Array(1, 0.482968, 1, 0.482968, 1, 0.482968, 1, 0.482968, 1, 1.23114, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.287175, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968),
"update": 0,
"values": [0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 9.0, 9.0, 10.0, 10.0, 11.0, 11.0, 12.0, 12.0, 13.0, 13.0, 14.0, 14.0, 15.0, 15.0, 16.0, 16.0, 17.0]
}
tracks/2/type = "method"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("../../..")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(17.6, 37.5667, 55.2667, 68.0667, 75.9667, 87.7),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
"values": [{
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"_on_text_finished"
}]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("..:custom_minimum_size")
tracks/3/interp = 2
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.7),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(900, 800), Vector2(900, 900)]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath(".:rotation")
tracks/4/interp = 2
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0, 1.8),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.174533, 0.349066]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("../..:modulate")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0, 0.733333),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("../../..:visible")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("../../..:modulate")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
[sub_resource type="Animation" id="Animation_x0d5q"]
resource_name = "vanish"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("../../..:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [true, false]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("../../..:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath(".:rotation")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(2.73208, 1),
"update": 0,
"values": [0.349066, 0.698132]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_dc6th"]
_data = {
"RESET": SubResource("Animation_ytihj"),
"de": SubResource("Animation_bgeog")
"de": SubResource("Animation_bgeog"),
"en": SubResource("Animation_7qabw"),
"vanish": SubResource("Animation_x0d5q")
}
[node name="childhood" type="CenterContainer"]
self_modulate = Color(1, 1, 1, 0.923078)
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
@ -286,12 +470,13 @@ anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = 118.0
offset_top = -256.0
offset_right = 630.0
offset_bottom = 256.0
offset_left = 117.0
offset_top = -263.0
offset_right = 1141.0
offset_bottom = 761.0
grow_horizontal = 0
grow_vertical = 2
scale = Vector2(0.5, 0.5)
texture = SubResource("ViewportTexture_2cudi")
[node name="SubViewport" type="SubViewport" parent="PanelContainer/StartFrame/TextureRect"]
@ -300,6 +485,7 @@ world_3d = SubResource("World3D_4m36g")
transparent_bg = true
msaa_3d = 1
canvas_cull_mask = 4293918724
size = Vector2i(1024, 1024)
render_target_update_mode = 4
[node name="Node3D" type="Node3D" parent="PanelContainer/StartFrame/TextureRect/SubViewport"]
@ -318,7 +504,7 @@ libraries = {
autoplay = "idle"
[node name="Camera3D" type="Camera3D" parent="PanelContainer/StartFrame/TextureRect/SubViewport/Node3D"]
transform = Transform3D(1, -4.88994e-09, 1.82221e-11, 4.88232e-09, 0.998636, 0.052214, -2.7352e-10, -0.052214, 0.998636, 0.0198479, 0.0554118, 0.529937)
transform = Transform3D(1, -4.88994e-09, 1.82221e-11, 4.88232e-09, 0.998636, 0.052214, -2.7352e-10, -0.052214, 0.998636, -0.0330043, 0.0554118, 0.529937)
current = true
fov = 33.0
@ -383,9 +569,9 @@ texture = ExtResource("3_o63m7")
expand_mode = 2
stretch_mode = 4
[node name="skip_control" parent="PanelContainer" instance=ExtResource("4_q0fee")]
[node name="SkipControl" parent="PanelContainer" instance=ExtResource("4_q0fee")]
unique_name_in_owner = true
layout_mode = 2
costum_owner = NodePath("../..")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
unique_name_in_owner = true
@ -396,7 +582,3 @@ libraries = {
[node name="Text" type="AudioStreamPlayer" parent="AnimationPlayer"]
bus = &"text"
[node name="Music" type="AudioStreamPlayer" parent="AnimationPlayer"]
volume_db = -10.0
bus = &"music"

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=12 format=3 uid="uid://cgwuoc1jfi7w6"]
[gd_scene load_steps=13 format=3 uid="uid://cgwuoc1jfi7w6"]
[ext_resource type="Script" path="res://base-environments/youth_room/scnees/scene_player.gd" id="1_o2rjr"]
[ext_resource type="Texture2D" uid="uid://d0ucjqi8tx6vt" path="res://import/interface-elements/frame.png" id="2_xwj2j"]
@ -70,10 +70,22 @@ tracks/4/keys = {
"update": 1,
"values": [false]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("../../..:modulate")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
[sub_resource type="Animation" id="Animation_bgeog"]
resource_name = "de"
length = 135.0
length = 151.0
tracks/0/type = "audio"
tracks/0/imported = false
tracks/0/enabled = true
@ -111,7 +123,7 @@ tracks/2/path = NodePath("../../..:progress")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 1.66667, 6.13333, 7.76667, 16.3, 19.0333, 26.7, 28.2, 34.9333, 36.7, 40.5, 41.9667, 44.6, 45.2, 49.2667, 50.4059, 55.2667, 56.0667, 58.8333, 60.8, 63.6667, 64.4667, 70.3058, 72.8, 82.2667, 83.8333, 90.0028, 91.0667, 97.6333, 99.7667, 106.526, 108.233, 117.933, 119.2, 121.633, 123.2, 132.033),
"times": PackedFloat32Array(0, 1.66667, 6.13333, 7.76667, 16.3, 19.0333, 26.7, 28.2, 34.9333, 36.7, 40.5, 41.9667, 44.6, 45.2, 49.2667, 50.4059, 55.2667, 56.0667, 58.8333, 60.8, 63.6667, 64.4667, 70.3058, 72.8, 82.2667, 83.8333, 90.0028, 91.0667, 97.6333, 99.7667, 106.526, 108.233, 117.933, 119.2, 121.633, 123.2, 132.1),
"transitions": PackedFloat32Array(1, 0.482968, 1, 0.482968, 1, 0.482968, 1, 0.482968, 1, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968, 0.482968),
"update": 0,
"values": [0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0, 7.0, 7.0, 8.0, 8.0, 9.0, 9.0, 10.0, 10.0, 11.0, 11.0, 12.0, 12.0, 13.0, 13.0, 14.0, 14.0, 15.0, 15.0, 16.0, 16.0, 17.0, 17.0, 18.0]
@ -123,13 +135,37 @@ tracks/3/path = NodePath("../../..")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(89.7667, 150.267),
"transitions": PackedFloat32Array(1, 1),
"times": PackedFloat32Array(27.2333, 37.5, 59.2667, 72, 82.2667, 89.7667, 106.167, 116.333, 133.8, 144.7),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"values": [{
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"try_scroll"
}, {
"args": [],
"method": &"_on_text_finished"
}, {
"args": [],
"method": &"trigger_intro"
}]
}
@ -184,7 +220,7 @@ tracks/7/keys = {
[sub_resource type="Animation" id="Animation_gpkkx"]
resource_name = "en"
length = 125.0
length = 150.0
tracks/0/type = "audio"
tracks/0/imported = false
tracks/0/enabled = true
@ -234,8 +270,8 @@ tracks/3/path = NodePath("../../..")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(16.5333, 40.5333, 60.6, 82.2333, 97.7333, 150.267),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
"times": PackedFloat32Array(16.5333, 40.5333, 60.6, 82.2333, 97.7333, 122.833, 144.533),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1),
"values": [{
"args": [],
"method": &"try_scroll"
@ -253,6 +289,9 @@ tracks/3/keys = {
"method": &"try_scroll"
}, {
"args": [],
"method": &"_on_text_finished"
}, {
"args": [],
"method": &"trigger_intro"
}]
}
@ -305,20 +344,61 @@ tracks/7/keys = {
"values": [true]
}
[sub_resource type="Animation" id="Animation_d2p1i"]
resource_name = "vanish"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("../../..:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [true, false]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("../../..:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath(".:rotation")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(2.21914, 1),
"update": 0,
"values": [0.349066, 0.523599]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_dc6th"]
_data = {
"RESET": SubResource("Animation_ytihj"),
"de": SubResource("Animation_bgeog"),
"en": SubResource("Animation_gpkkx")
"en": SubResource("Animation_gpkkx"),
"vanish": SubResource("Animation_d2p1i")
}
[node name="draven" type="CenterContainer"]
visible = false
self_modulate = Color(1, 1, 1, 0.923078)
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = -877.0
offset_left = 2.0
offset_right = -875.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_o2rjr")
@ -381,9 +461,7 @@ bbcode_enabled = true
text = "Moonlight trickled down trough clouds and twigs as Dräven tapped trough the night.He had been searching for a while and he knew a special someone must be hiding in the thicket.When a familiar smell first led him to a few bronce hairs as fluffy as his tail, he didnt think much of it.But then he saw paw-prints, that matched his own where he had not been. Would he finally find someone of his kind?He was sure of it, as the familiar scent has never been stronger than tonight.When suddently: Was that chatter?His wings rustled with joy over the familiar voice and Dräven decided to get a better look.A few flaps and leaps brought him up a tree, to get a glimpse of his soon to be friend.But all he saw was a fox.He didnt even want to bother it anymore.It would just scream and laugh at his wings of leafs, just like the trees crackled at his paws, that were no roots.With a small whimper, Dräven spread his wings, and slid away to at least find comfort by seeing his reflection in the nearby lake.It took him a while to notice, how there was a sudden silence when the clouds broke: Northern lights danced trough the sky to form wings, that met at a sleak body made of stars and clouds.The whole forest held its breath as it stared into eyes of moonlight gazing down.Dräven was moved to tears when he gazed back at it. He was sad for the dragon that was of the moon and the stars and the skies. It must feel so lost in the universe. But his tears were of joy: It was the first time Dräven saw another creature of many kinds."
fit_content = true
scroll_active = false
visible_characters = 1082
visible_characters_behavior = 1
visible_ratio = 0.709974
[node name="StartBottom" type="TextureRect" parent="PanelContainer/VBoxContainer"]
custom_minimum_size = Vector2(0, 64)
@ -393,9 +471,9 @@ texture = ExtResource("4_qgfj8")
expand_mode = 2
stretch_mode = 4
[node name="skip_control" parent="PanelContainer" instance=ExtResource("5_ddnfo")]
[node name="SkipControl" parent="PanelContainer" instance=ExtResource("5_ddnfo")]
unique_name_in_owner = true
layout_mode = 2
costum_owner = NodePath("../..")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
unique_name_in_owner = true
@ -411,4 +489,4 @@ bus = &"text"
volume_db = -10.0
bus = &"music"
[connection signal="scroll_started" from="PanelContainer/VBoxContainer/StoryScroll" to="PanelContainer/skip_control" method="abort_auto_proceed"]
[connection signal="scroll_started" from="PanelContainer/VBoxContainer/StoryScroll" to="PanelContainer/SkipControl" method="abort_auto_proceed"]

View File

@ -1,11 +1,13 @@
@tool
extends CenterContainer
signal text_finished
signal finished
signal intro
#TODO properly implement animation taking stage, as it should do, disabling processing when it does not have stage.
var max_lines: float = 0
@export var story_array: Array[String] = []:
set(array):
story_array = array
@ -17,7 +19,8 @@ signal intro
for str in array:
label.text += TranslationServer.translate(str).replace("[/p]", "[/p][p][font_size=8] [/font_size][/p]")
substring_sizes.append(TranslationServer.translate(str).replace("[/p]", ".").replace("[p]", "").length())
max_lines = float(label.get_line_count())
@export var progress: float = 0:
set(value):
progress = value
@ -25,39 +28,61 @@ signal intro
var start_index = 0
if progress >= substring_sizes.size() or progress < 0:
label.visible_ratio = 1
elif progress >= 1:
elif progress > 0:
for i in range(min(progress, substring_sizes.size()-1) as int) if progress > 0 else range(substring_sizes.size()-1):
start_index += substring_sizes[i]
label.visible_characters = start_index + substring_sizes[min(progress as int, substring_sizes.size()-1)] * fmod(progress, 1)
else:
label.visible_ratio = 0
@export var test_scroll: bool:
set(scroll):
try_scroll()
@onready var story_label: Label
@onready var label:RichTextLabel = %StoryLabel
@onready var scroll_container:ScrollContainer = %StoryScroll
@onready var animation_player: AnimationPlayer = %AnimationPlayer
@onready var skip_control: SkipControl = %SkipControl
@export var animation_complete:bool = false:
set(value):
animation_complete = value
if value:
scroll_container.scroll_vertical = ScrollContainer.ScrollMode.SCROLL_MODE_AUTO
scroll_container.vertical_scroll_mode = ScrollContainer.ScrollMode.SCROLL_MODE_AUTO
progress = -1
else:
scroll_container.scroll_vertical = ScrollContainer.ScrollMode.SCROLL_MODE_DISABLED
animation_complete = value
var substring_sizes: Array[int]
func _ready() -> void:
if get_tree().root == self:
skip_control = %SkipControl
if skip_control is SkipControl:
skip_control.skip.connect(skip_text)
if get_tree().root.get_child(-1) == self:
play_scene()
story_array = story_array
progress = progress
func try_scroll():
var scroll_target: int
if get_minimum_size().y * label.visible_ratio + scroll_container.scroll_vertical > scroll_container.get_minimum_size().y * 0.9:
if get_minimum_size().y * label.visible_ratio + scroll_container.scroll_vertical + scroll_container.get_minimum_size().y * 0.9 > label.get_minimum_size().y:
scroll_target = scroll_container.scroll_vertical + scroll_container.get_minimum_size().y * 0.8
#print( "max lines: " + str(max_lines))
#print( "current lines: " + str(label.get_character_line(label.visible_characters)))
var visible_ratio: float = float(label.get_character_line(label.visible_characters)) / max_lines
#print("Tried scrolling with ratio of %f. Comparing %f against %f" % [visible_ratio, label.size.y * visible_ratio - scroll_container.scroll_vertical, scroll_container.size.y * 0.9])
if label.size.y * visible_ratio + scroll_container.scroll_vertical > scroll_container.size.y * 0.9:
if scroll_container.scroll_vertical + scroll_container.size.y * 0.9 < label.size.y:
scroll_target = scroll_container.scroll_vertical + scroll_container.size.y * 0.8
else:
scroll_target = label.get_minimum_size().y - scroll_container.get_minimum_size().y
scroll_target = label.size.y - scroll_container.size.y
if scroll_target != null:
var tween: Tween = get_tree().create_tween()
##tween.set_trans()
@ -72,21 +97,34 @@ func play_scene():
"en":
animation_player.queue("en")
await animation_player.animation_finished
await text_finished
if name == "draven":
trigger_intro()
animation_complete = true
skip_control.start_proceed_countdown()
await skip_control.proceed
animation_player.play("vanish")
await animation_player.animation_finished
finished.emit()
var intro_triggered:= false
func trigger_intro():
if not intro_triggered:
intro.emit()
intro_triggered = true
func skip_text():
animation_complete = true
if not animation_complete:
animation_player.stop(true)
text_finished.emit()
func _on_text_finished():
if not animation_complete:
text_finished.emit()

View File

@ -14,11 +14,53 @@ grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_ols6o")
[node name="draeven" type="Control" parent="."]
anchors_preset = 0
offset_left = 190.0
offset_top = 141.0
offset_right = 230.0
offset_bottom = 181.0
[node name="c_out-of-world" parent="draeven" instance=ExtResource("1_xrckx")]
text = "I feel like I am not from of this world"
[node name="p_unique" parent="draeven/c_out-of-world" groups=["c_comic_heroes", "c_confusion", "c_hit", "c_homework", "c_joy", "c_out-of-world", "c_teachers"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 50)
text = "I like being unique like that"
[node name="p_few_friends" parent="draeven/c_out-of-world" groups=["c_comic_heroes", "c_fighting", "c_joy", "c_out-of-world", "c_rejection", "c_teachers", "c_teasing"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 140)
text = "I am thankful for the few friends that get me"
[node name="c_rejection" parent="draeven" instance=ExtResource("1_xrckx")]
position = Vector2(0, 300)
text = "I fear being rejected"
[node name="p_friends" parent="draeven/c_rejection" groups=["c_boy_stuff", "c_comic_heroes", "c_fighting", "c_homework", "c_joy", "c_out-of-world", "c_rejection", "c_teachers"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 50)
text = "that makes it hard to find friends"
[node name="p_laughed" parent="draeven/c_rejection" groups=["c_boy_stuff", "c_comic_heroes", "c_confusion", "c_homework", "c_joy", "c_rejection", "c_teachers"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 140)
text = "I'm afraid I will just get laughed at"
[node name="c_confusion" parent="draeven" instance=ExtResource("1_xrckx")]
position = Vector2(0, 600)
text = "I am just too many things at once"
[node name="p_inner_conflict" parent="draeven/c_confusion" groups=["c_boy_stuff", "c_confusion", "c_fighting", "c_homework", "c_rejection", "c_teasing"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 50)
text = "it is just so overwhealming for me"
[node name="p_outer_conflict" parent="draeven/c_confusion" groups=["c_boy_stuff", "c_confusion", "c_fighting", "c_hit", "c_homework", "c_joy", "c_out-of-world", "c_rejection", "c_teachers"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 140)
text = "this is just too much for others"
[node name="childhood" type="Control" parent="."]
anchors_preset = 0
offset_left = 184.0
offset_left = 554.0
offset_top = 141.0
offset_right = 224.0
offset_right = 594.0
offset_bottom = 181.0
[node name="c_homework" parent="childhood" instance=ExtResource("1_xrckx")]
@ -58,9 +100,9 @@ text = "Mr Thomas thinks that makes me gifted."
[node name="voice_training" type="Control" parent="."]
anchors_preset = 0
offset_left = 534.0
offset_left = 904.0
offset_top = 141.0
offset_right = 534.0
offset_right = 904.0
offset_bottom = 141.0
[node name="c_comic_heroes" parent="voice_training" instance=ExtResource("1_xrckx")]
@ -86,8 +128,9 @@ text = "yet they think I'm just pretending"
position = Vector2(-32, 140)
text = "and girls don't get that."
[node name="c_teasing" parent="voice_training" instance=ExtResource("1_xrckx")]
[node name="c_teasing" parent="voice_training" node_paths=PackedStringArray("evil_sticky_notes") instance=ExtResource("1_xrckx")]
position = Vector2(0, 600)
evil_sticky_notes = [NodePath("../../childhood/c_joy/p_thomas")]
text = "When Jojo got teased for trying, I pretty much exploded"
[node name="p_stubborn" parent="voice_training/c_teasing" groups=["c_boy_stuff", "c_comic_heroes", "c_confusion", "c_fighting", "c_hit", "c_homework", "c_joy", "c_out-of-world", "c_teasing"] instance=ExtResource("2_ucudl")]
@ -100,9 +143,9 @@ text = "I will always stand up for the good intended"
[node name="juijutsu" type="Control" parent="."]
anchors_preset = 0
offset_left = 884.0
offset_left = 1254.0
offset_top = 141.0
offset_right = 884.0
offset_right = 1254.0
offset_bottom = 141.0
[node name="c_fighting" parent="juijutsu" instance=ExtResource("1_xrckx")]
@ -127,8 +170,9 @@ text = "I was wet, so I must have been into it."
position = Vector2(-32, 140)
text = "I didnt say stop."
[node name="c_hit" parent="juijutsu" instance=ExtResource("1_xrckx")]
[node name="c_hit" parent="juijutsu" node_paths=PackedStringArray("evil_sticky_notes") instance=ExtResource("1_xrckx")]
position = Vector2(0, 300)
evil_sticky_notes = [NodePath("../../childhood/c_teachers/p_becoming_teacher")]
text = "I know how to properly hit people "
[node name="p_confidence" parent="juijutsu/c_hit" groups=["c_boy_stuff", "c_comic_heroes", "c_hit", "c_homework", "c_joy", "c_teasing"] instance=ExtResource("2_ucudl")]
@ -139,48 +183,6 @@ text = "that gives me a lot of confidence."
position = Vector2(-32, 140)
text = "and thats a great vent."
[node name="draeven" type="Control" parent="."]
anchors_preset = 0
offset_left = 1234.0
offset_top = 141.0
offset_right = 1274.0
offset_bottom = 181.0
[node name="c_out-of-world" parent="draeven" instance=ExtResource("1_xrckx")]
text = "I feel like I am not from of this world"
[node name="p_unique" parent="draeven/c_out-of-world" groups=["c_comic_heroes", "c_confusion", "c_hit", "c_homework", "c_joy", "c_out-of-world", "c_teachers"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 50)
text = "I like being unique like that"
[node name="p_few_friends" parent="draeven/c_out-of-world" groups=["c_comic_heroes", "c_fighting", "c_joy", "c_out-of-world", "c_rejection", "c_teachers", "c_teasing"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 140)
text = "I am thankful for the few friends that get me"
[node name="c_rejection" parent="draeven" instance=ExtResource("1_xrckx")]
position = Vector2(0, 300)
text = "I fear being rejected"
[node name="p_friends" parent="draeven/c_rejection" groups=["c_boy_stuff", "c_comic_heroes", "c_fighting", "c_homework", "c_joy", "c_out-of-world", "c_rejection", "c_teachers"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 50)
text = "that makes it hard to find friends"
[node name="p_laughed" parent="draeven/c_rejection" groups=["c_boy_stuff", "c_comic_heroes", "c_confusion", "c_homework", "c_joy", "c_rejection", "c_teachers"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 140)
text = "I'm afraid I will just get laughed at"
[node name="c_confusion" parent="draeven" instance=ExtResource("1_xrckx")]
position = Vector2(0, 600)
text = "I am just too many things at once"
[node name="p_inner_conflict" parent="draeven/c_confusion" groups=["c_boy_stuff", "c_confusion", "c_fighting", "c_homework", "c_rejection", "c_teasing"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 50)
text = "it is just so overwhealming for me"
[node name="p_outer_conflict" parent="draeven/c_confusion" groups=["c_boy_stuff", "c_confusion", "c_fighting", "c_hit", "c_homework", "c_joy", "c_out-of-world", "c_rejection", "c_teachers"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 140)
text = "this is just too much for others"
[node name="test2" type="Control" parent="."]
anchors_preset = 0
offset_left = 1610.0

View File

@ -57,10 +57,13 @@ var curr_selection_id: int = -1:
var output:Array = []
var options:Array = []
signal cards_picked(Array)
signal cards_picked(cardnames: Array[String])
# Called when the node enters the scene tree for the first time.
func _ready():
for id in range(Scenes.id.YOUTH_DRAEVEN, Scenes.id.YOUTH_JUI_JUTSU + 1):
Scenes.sign_up_for_sequence(pick_cards, id, 1)
reset()
func reset():
@ -197,7 +200,7 @@ func transition():
cards_picked.emit(out_str)
get_parent().get_parent().get_parent().dnd = false
selection_state = DONE
State.leave_stage(self)
Scenes.end_current_sequence()
func show_posts():
selection_state = POSTS
@ -214,13 +217,15 @@ func handle_mouse_button(new_selection: Node, button_event: InputEventMouseButto
if button_event.button_index == MOUSE_BUTTON_LEFT and button_event.pressed:
pick(options.find(new_selection))
func scene_finished(id: int, repeat):
func pick_cards(id: int, repeat: bool):
print(name, id, repeat)
if not repeat:
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
fill_card_slots(id)
State.transition_stage_to(self, true)
#State.transition_stage_to(self, true)
selection_state = CARDS
else:
Scenes.end_current_sequence()
func play_scene(_id, _repeat):
pass

View File

@ -2,7 +2,7 @@
extends CenterContainer
class_name Collectable_Ui
@export var scene = Scenes.id
@export var scene:Scenes.id = 0
@export var collapsed = true:
set(collapse):
@ -21,10 +21,10 @@ class_name Collectable_Ui
if collapse and has_stage: State.leave_stage(self)
@export var is_story: bool = false:
set(story):
is_story = story
if not story:
@export var is_board: bool = false:
set(board):
is_board = board
if board:
$Panel/Content/Buttons/VBoxContainer/collect_or_listen.text = "Order Thoughts"
else:
$Panel/Content/Buttons/VBoxContainer/collect_or_listen.text = "Collect Memento"
@ -48,7 +48,7 @@ class_name Collectable_Ui
collected = set_collected
if set_collected:
$Panel/Content/Buttons/VBoxContainer/put_back.show()
if is_story:
if not is_board:
$Panel/Content/Buttons/VBoxContainer/put_back.disabled = true
$Panel/Content/Buttons/VBoxContainer/collect_or_listen.text = "listen again"
if State.allow_skipping:
@ -85,7 +85,7 @@ func _ready():
if visible and not collapsed: _show_buttons()
content_notes = content_notes
is_story = is_story
is_board = is_board
item_name = item_name
func _hide_buttons():
@ -114,7 +114,7 @@ func hide():
func show():
if !visible:
$Panel/Content/ContentNotes.visible = State.show_content_notes
$Panel/Content/Buttons/VBoxContainer/skip.visible = State.allow_skipping and is_story and not skipped
$Panel/Content/Buttons/VBoxContainer/skip.visible = State.allow_skipping and not is_board and not skipped
if not collapsed:
_show_buttons()
modulate = Color()
@ -128,9 +128,10 @@ func _yoink_focus():
func _on_pick_button_pressed():
print("card collected!")
if scene != null:
if not is_board:
Scenes.start_sequence(scene)
State.leave_stage(self)
get_tree().call_group("scene_actors", "play_scene", scene, collected)
#get_tree().call_group("scene_actors", "play_scene", scene, collected)
if skipped: emit_signal("scene_skipped", -1)
collected = true
else:

View File

@ -101,7 +101,6 @@ grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("1_2apkb")
script = ExtResource("1_tgjc2")
scene = null
[node name="Panel" type="PanelContainer" parent="."]
clip_children = 2
@ -137,7 +136,7 @@ size_flags_vertical = 3
[node name="collect_or_listen" type="Button" parent="Panel/Content/Buttons/VBoxContainer"]
layout_mode = 2
tooltip_text = "Take this with you, and listen to it's story."
text = "Order Thoughts"
text = "Collect Memento"
script = SubResource("GDScript_g0qhf")
[node name="Summary" type="Button" parent="Panel/Content/Buttons/VBoxContainer"]

View File

@ -1,35 +1,41 @@
extends Control
class_name SkipControl extends Control
signal skip
signal proceed
signal _transition_text
@export var skip_delay: float = 0.5
@export var auto_continue_delay: float = 1
@export var costum_owner: NodePath
@export var auto_continue_delay: float = 2
var time_pressed: float = 0
@onready var button: Button = %SkipButton
@onready var progress: ProgressBar = %ProgressBar
# control is hidden when there is no input.
var unrevealed: bool = true
# as this can be pressed for multiple reasons, this variable is keeping track of all of them.
var pressed: bool = false
# determines wheather or not the scene is waiting for a proceed or listening for a skip.
var proceeding: bool = false:
set(value):
proceeding = value
if proceeding and is_node_ready():
#FIXME: animation implementieren >:3
button.text = "continue"
if value and is_node_ready():
if unrevealed:
$AnimationPlayer.play("reveal_skip")
unrevealed = false
else:
$AnimationPlayer.play("replace_text")
await _transition_text
button.text = "continuing ..."
elif is_node_ready():
button.text = "skip to end (hold)"
var auto_proceed: bool = false:
button.text = "skip reading (hold)"
proceeding = value
# while this is true, a counter counts up to automatically proceed.
var is_auto_proceeding: bool = true:
set(value):
auto_proceed = value
is_auto_proceeding = value
#resets progress bar on button
time_pressed = 0
func _ready():
if costum_owner != NodePath(""):
owner = get_node(costum_owner)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if pressed and is_visible_in_tree():
@ -37,22 +43,30 @@ func _process(delta):
progress.value = time_pressed / skip_delay
if time_pressed >= skip_delay:
skip.emit()
print("emmitted skip!")
pressed = false
time_pressed = 0
elif auto_proceed:
elif is_auto_proceeding and proceeding:
time_pressed += delta
progress.value = time_pressed / auto_continue_delay
if time_pressed >= auto_continue_delay:
proceed.emit()
reset()
func _unhandled_input(event: InputEvent) -> void:
if is_visible_in_tree():
if not event is InputEventMouseMotion and unrevealed:
$AnimationPlayer.play("reveal_skip")
unrevealed = false
if event.is_action_pressed("skip"):
if not proceeding:
pressed = true
else:
proceed.emit()
reset()
get_viewport().set_input_as_handled()
elif event.is_action_released("skip"):
if not proceeding:
@ -60,10 +74,14 @@ func _unhandled_input(event: InputEvent) -> void:
time_pressed = 0
progress.value = 0
get_viewport().set_input_as_handled()
elif event.is_action_pressed("ui_accept") or event.is_action_pressed("ui_focus_next"):
elif Input.is_action_just_pressed("ui_accept") or Input.is_action_just_pressed("ui_focus_next") or Input.is_action_just_pressed("skip") and proceeding:
proceed.emit()
get_viewport().set_input_as_handled()
reset()
elif event.is_action_pressed("ui_cancel"):
# FIXME this right now would be consumed by the pause menu.
is_auto_proceeding = false
get_viewport().set_input_as_handled()
func _on_skip_button_toggled(button_pressed):
if button_pressed:
@ -72,8 +90,14 @@ func _on_skip_button_toggled(button_pressed):
pressed = false
time_pressed = 0
func change_to_proceed_mode():
func start_proceed_countdown():
proceeding = true
func abort_auto_proceed():
auto_proceed = false
func transition_text():
_transition_text.emit()
func reset():
$AnimationPlayer.play("RESET")
unrevealed = true
pressed = false
proceeding = false

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=8 format=3 uid="uid://dvwuhobhka78d"]
[gd_scene load_steps=13 format=3 uid="uid://dvwuhobhka78d"]
[ext_resource type="Script" path="res://logic-scenes/misc/skip_control.gd" id="1_s6riu"]
[ext_resource type="Script" path="res://addons/input_prompts/action_prompt/action_prompt.gd" id="2_ev8gx"]
@ -17,27 +17,210 @@ corner_radius_bottom_left = 5
expand_margin_top = 5.0
expand_margin_bottom = 5.0
[sub_resource type="InputEventKey" id="InputEventKey_krb4k"]
[sub_resource type="InputEventKey" id="InputEventKey_hvidk"]
device = -1
physical_keycode = 88
unicode = 120
[sub_resource type="InputEventJoypadButton" id="InputEventJoypadButton_3b2du"]
[sub_resource type="InputEventJoypadButton" id="InputEventJoypadButton_eo4uy"]
device = -1
button_index = 2
pressed = true
[node name="skip_control" type="Control"]
process_mode = 4
[sub_resource type="Animation" id="Animation_24cc4"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("SkipButton:self_modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("SkipButton:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("SkipButton/ActionPrompt:modulate")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 0)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("SkipButton/ActionPrompt:scale")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(1, 1)]
}
[sub_resource type="Animation" id="Animation_7t2h7"]
resource_name = "replace_text"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("SkipButton:self_modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("SkipButton:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.733333, 1),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/2/type = "method"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath(".")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0.733333),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"transition_text"
}]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("SkipButton/ActionPrompt:modulate")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
[sub_resource type="Animation" id="Animation_wpc0s"]
resource_name = "reveal_skip"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("SkipButton:self_modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.466667),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("SkipButton/ActionPrompt:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.133333),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
[sub_resource type="Animation" id="Animation_5y7a2"]
resource_name = "skip_pressed"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("SkipButton:self_modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.2, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("SkipButton/ActionPrompt:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.333333, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("SkipButton/ActionPrompt:scale")
tracks/2/interp = 2
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.0666667, 0.433333),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector2(0.8, 0.8), Vector2(1.1, 1.1), Vector2(1, 1)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_f8gbl"]
_data = {
"RESET": SubResource("Animation_24cc4"),
"replace_text": SubResource("Animation_7t2h7"),
"reveal_skip": SubResource("Animation_wpc0s"),
"skip_pressed": SubResource("Animation_5y7a2")
}
[node name="SkipControl" type="Control"]
layout_mode = 3
anchors_preset = 0
offset_left = 750.0
offset_top = 260.0
offset_right = 750.0
offset_bottom = 260.0
size_flags_horizontal = 4
size_flags_vertical = 8
script = ExtResource("1_s6riu")
[node name="SkipButton" type="Button" parent="."]
unique_name_in_owner = true
visible = false
self_modulate = Color(1, 1, 1, 0)
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
@ -50,7 +233,7 @@ offset_right = 108.0
offset_bottom = 21.5
grow_horizontal = 2
grow_vertical = 2
text = "skip to end (hold)"
text = "skip reading (hold)"
[node name="ProgressBar" type="ProgressBar" parent="SkipButton"]
unique_name_in_owner = true
@ -66,21 +249,28 @@ max_value = 1.0
show_percentage = false
[node name="ActionPrompt" type="TextureRect" parent="SkipButton"]
modulate = Color(1, 1, 1, 0)
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = -55.0
offset_left = -57.0
offset_top = -25.0
offset_right = -5.0
offset_right = -7.0
offset_bottom = 25.0
grow_vertical = 2
pivot_offset = Vector2(25, 25)
texture = ExtResource("2_pnwbx")
expand_mode = 2
stretch_mode = 5
script = ExtResource("2_ev8gx")
action = "skip"
icon = 0
events = Array[InputEvent]([null, SubResource("InputEventKey_krb4k"), SubResource("InputEventJoypadButton_3b2du")])
events = Array[InputEvent]([null, SubResource("InputEventKey_hvidk"), SubResource("InputEventJoypadButton_eo4uy")])
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_f8gbl")
}
[connection signal="toggled" from="SkipButton" to="." method="_on_skip_button_toggled"]

View File

@ -76,10 +76,6 @@ signal ui_exited
func _ready():
_handle_jitter(0)
func _on_ini_room():
State.take_stage(self)
get_tree().call_group("scene_actors", "play_scene", Scenes.id.YOUTH_DRAEVEN, false)
State.queue_for_stage(self)
func _process(_delta):

View File

@ -22,7 +22,7 @@ var current_room_id: State.rooms
var in_game = false
var current_loaded_room: Node3D
var current_room: RoomTemplate
var currently_loading_room: String = "":
set(path):
if path != "":
@ -42,9 +42,9 @@ func _ready():
func _process(delta: float) -> void:
if currently_loading_room != "":
if ResourceLoader.load_threaded_get_status(currently_loading_room) == 3:
current_loaded_room = ResourceLoader.load_threaded_get(youth_room_path).instantiate()
add_child(current_loaded_room)
move_child(current_loaded_room, 0)
current_room = ResourceLoader.load_threaded_get(youth_room_path).instantiate()
add_child(current_room)
move_child(current_room, 0)
currently_loading_room = ""
room_loaded.emit()
@ -87,7 +87,6 @@ func load_save(save: SaveGame):
menu_animation["parameters/conditions/start_game"] = true
State.active_save_game = save
State.pass_stage_to(get_child(0))
func _on_ready_to_unload():
if get_child(0) is Node3D:
@ -106,7 +105,8 @@ func get_room_path_from_id(id: State.rooms) -> String:
func start_demo():
load_save(SaveGame.new())
$"Messe-Menue".hide()
$DemoMenue.hide()
current_room.start_room()
var last_mode := DisplayServer.WINDOW_MODE_WINDOWED
func _unhandled_input(event: InputEvent) -> void:

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=48 format=3 uid="uid://b51wdql4mby47"]
[gd_scene load_steps=70 format=3 uid="uid://b51wdql4mby47"]
[ext_resource type="Theme" uid="uid://b056fn288p8ha" path="res://logic-scenes/themes/handwriting.theme" id="1_2dg4n"]
[ext_resource type="Script" path="res://logic-scenes/main menu/main_menu.gd" id="2_rm576"]
@ -569,6 +569,248 @@ thumbnail = ExtResource("12_6qu04")
last_saved = 1.73694e+09
is_save_file_valid = false
[sub_resource type="Resource" id="Resource_tndbn"]
script = ExtResource("11_cspq7")
filepath = ""
unique_save_name = "frame_of_mind_2025-01-16_17:40:32"
current_room = 0
mementos_complete = 0
board_state = {}
thumbnail = ExtResource("12_6qu04")
last_saved = 1.73705e+09
is_save_file_valid = false
[sub_resource type="Resource" id="Resource_lufme"]
script = ExtResource("11_cspq7")
filepath = ""
unique_save_name = "frame_of_mind_2025-01-16_17:52:29"
current_room = 0
mementos_complete = 0
board_state = {}
thumbnail = ExtResource("12_6qu04")
last_saved = 1.73705e+09
is_save_file_valid = false
[sub_resource type="Resource" id="Resource_l53wn"]
script = ExtResource("11_cspq7")
filepath = ""
unique_save_name = "frame_of_mind_2025-01-16_17:54:52"
current_room = 0
mementos_complete = 0
board_state = {}
thumbnail = ExtResource("12_6qu04")
last_saved = 1.73705e+09
is_save_file_valid = false
[sub_resource type="Resource" id="Resource_clwx4"]
script = ExtResource("11_cspq7")
filepath = ""
unique_save_name = "frame_of_mind_2025-01-16_17:58:18"
current_room = 0
mementos_complete = 0
board_state = {}
thumbnail = ExtResource("12_6qu04")
last_saved = 1.73705e+09
is_save_file_valid = false
[sub_resource type="Resource" id="Resource_yficn"]
script = ExtResource("11_cspq7")
filepath = ""
unique_save_name = "frame_of_mind_2025-01-24_14:21:05"
current_room = 0
mementos_complete = 0
board_state = {}
thumbnail = ExtResource("12_6qu04")
last_saved = 1.73772e+09
is_save_file_valid = false
[sub_resource type="Resource" id="Resource_vm06g"]
script = ExtResource("11_cspq7")
filepath = ""
unique_save_name = "frame_of_mind_2025-01-28_19:47:40"
current_room = 0
mementos_complete = 0
board_state = {}
thumbnail = ExtResource("12_6qu04")
last_saved = 1.73809e+09
is_save_file_valid = false
[sub_resource type="Resource" id="Resource_goirg"]
script = ExtResource("11_cspq7")
filepath = ""
unique_save_name = "frame_of_mind_2025-01-28_19:48:01"
current_room = 0
mementos_complete = 0
board_state = {}
thumbnail = ExtResource("12_6qu04")
last_saved = 1.73809e+09
is_save_file_valid = false
[sub_resource type="Resource" id="Resource_ddf3p"]
script = ExtResource("11_cspq7")
filepath = ""
unique_save_name = "frame_of_mind_2025-01-28_20:00:52"
current_room = 0
mementos_complete = 0
board_state = {}
thumbnail = ExtResource("12_6qu04")
last_saved = 1.73809e+09
is_save_file_valid = false
[sub_resource type="Resource" id="Resource_uu0gn"]
script = ExtResource("11_cspq7")
filepath = ""
unique_save_name = "frame_of_mind_2025-01-28_20:51:41"
current_room = 0
mementos_complete = 0
board_state = {}
thumbnail = ExtResource("12_6qu04")
last_saved = 1.73809e+09
is_save_file_valid = false
[sub_resource type="Resource" id="Resource_4ysr1"]
script = ExtResource("11_cspq7")
filepath = ""
unique_save_name = "frame_of_mind_2025-01-30_10:13:26"
current_room = 0
mementos_complete = 0
board_state = {}
thumbnail = ExtResource("12_6qu04")
last_saved = 1.73823e+09
is_save_file_valid = false
[sub_resource type="Resource" id="Resource_6y6p0"]
script = ExtResource("11_cspq7")
filepath = ""
unique_save_name = "frame_of_mind_2025-01-30_14:11:49"
current_room = 0
mementos_complete = 0
board_state = {}
thumbnail = ExtResource("12_6qu04")
last_saved = 1.73824e+09
is_save_file_valid = false
[sub_resource type="Resource" id="Resource_1n48n"]
script = ExtResource("11_cspq7")
filepath = ""
unique_save_name = "frame_of_mind_2025-01-30_23:18:41"
current_room = 0
mementos_complete = 0
board_state = {}
thumbnail = ExtResource("12_6qu04")
last_saved = 1.73828e+09
is_save_file_valid = false
[sub_resource type="Resource" id="Resource_63rnc"]
script = ExtResource("11_cspq7")
filepath = ""
unique_save_name = "frame_of_mind_2025-02-01_13:11:25"
current_room = 0
mementos_complete = 0
board_state = {}
thumbnail = ExtResource("12_6qu04")
last_saved = 1.73841e+09
is_save_file_valid = false
[sub_resource type="Resource" id="Resource_0l6tr"]
script = ExtResource("11_cspq7")
filepath = ""
unique_save_name = "frame_of_mind_2025-02-01_23:01:04"
current_room = 0
mementos_complete = 0
board_state = {}
thumbnail = ExtResource("12_6qu04")
last_saved = 1.73845e+09
is_save_file_valid = false
[sub_resource type="Resource" id="Resource_inx16"]
script = ExtResource("11_cspq7")
filepath = ""
unique_save_name = "frame_of_mind_2025-02-01_23:40:34"
current_room = 0
mementos_complete = 0
board_state = {}
thumbnail = ExtResource("12_6qu04")
last_saved = 1.73845e+09
is_save_file_valid = false
[sub_resource type="Resource" id="Resource_mkuia"]
script = ExtResource("11_cspq7")
filepath = ""
unique_save_name = "frame_of_mind_2025-02-02_13:25:12"
current_room = 0
mementos_complete = 0
board_state = {}
thumbnail = ExtResource("12_6qu04")
last_saved = 1.7385e+09
is_save_file_valid = false
[sub_resource type="Resource" id="Resource_5kds2"]
script = ExtResource("11_cspq7")
filepath = ""
unique_save_name = "frame_of_mind_2025-02-03_11:45:45"
current_room = 0
mementos_complete = 0
board_state = {}
thumbnail = ExtResource("12_6qu04")
last_saved = 1.73858e+09
is_save_file_valid = false
[sub_resource type="Resource" id="Resource_iifks"]
script = ExtResource("11_cspq7")
filepath = ""
unique_save_name = "frame_of_mind_2025-02-04_17:57:23"
current_room = 0
mementos_complete = 0
board_state = {}
thumbnail = ExtResource("12_6qu04")
last_saved = 1.73869e+09
is_save_file_valid = false
[sub_resource type="Resource" id="Resource_8kl1j"]
script = ExtResource("11_cspq7")
filepath = ""
unique_save_name = "frame_of_mind_2025-02-05_12:28:34"
current_room = 0
mementos_complete = 0
board_state = {}
thumbnail = ExtResource("12_6qu04")
last_saved = 1.73875e+09
is_save_file_valid = false
[sub_resource type="Resource" id="Resource_278t0"]
script = ExtResource("11_cspq7")
filepath = ""
unique_save_name = "frame_of_mind_2025-02-05_15:42:46"
current_room = 0
mementos_complete = 0
board_state = {}
thumbnail = ExtResource("12_6qu04")
last_saved = 1.73877e+09
is_save_file_valid = false
[sub_resource type="Resource" id="Resource_c184q"]
script = ExtResource("11_cspq7")
filepath = ""
unique_save_name = "frame_of_mind_2025-02-05_18:11:33"
current_room = 0
mementos_complete = 0
board_state = {}
thumbnail = ExtResource("12_6qu04")
last_saved = 1.73878e+09
is_save_file_valid = false
[sub_resource type="Resource" id="Resource_cb0ow"]
script = ExtResource("11_cspq7")
filepath = ""
unique_save_name = "frame_of_mind_2025-02-06_15:57:40"
current_room = 0
mementos_complete = 0
board_state = {}
thumbnail = ExtResource("12_6qu04")
last_saved = 1.73885e+09
is_save_file_valid = false
[node name="Main Menu" type="Panel"]
anchors_preset = 15
anchor_right = 1.0
@ -580,6 +822,7 @@ theme_override_styles/panel = SubResource("StyleBoxEmpty_njt06")
script = ExtResource("2_rm576")
[node name="TextureRect" type="TextureRect" parent="."]
visible = false
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
@ -596,6 +839,7 @@ scale = Vector2(0.5, 0.5)
texture = ExtResource("3_xb2np")
[node name="PanelContainer" type="VBoxContainer" parent="."]
visible = false
layout_mode = 1
offset_left = 67.0
offset_top = 70.0
@ -726,7 +970,7 @@ anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("8_o0cpj")
saves = Array[ExtResource("11_cspq7")]([SubResource("Resource_civda"), SubResource("Resource_ny8h2"), SubResource("Resource_eypce"), SubResource("Resource_0aleq"), SubResource("Resource_yamni"), SubResource("Resource_ofqsy"), SubResource("Resource_775qv"), SubResource("Resource_epdda"), SubResource("Resource_idh7b"), SubResource("Resource_yy8tc"), SubResource("Resource_yo5qr"), SubResource("Resource_7axnv"), SubResource("Resource_r3oqr"), SubResource("Resource_7hoak"), SubResource("Resource_x034i"), SubResource("Resource_hv6lt"), SubResource("Resource_ngwc0"), SubResource("Resource_dsk3l"), SubResource("Resource_efgi1"), SubResource("Resource_xenjc"), SubResource("Resource_2mijl"), SubResource("Resource_mucpl"), SubResource("Resource_dxffb"), SubResource("Resource_4c35o"), SubResource("Resource_4cd2u"), SubResource("Resource_ye22d"), SubResource("Resource_m18wr"), SubResource("Resource_jed2g"), SubResource("Resource_jel4s")])
saves = Array[ExtResource("11_cspq7")]([SubResource("Resource_civda"), SubResource("Resource_ny8h2"), SubResource("Resource_eypce"), SubResource("Resource_0aleq"), SubResource("Resource_yamni"), SubResource("Resource_ofqsy"), SubResource("Resource_775qv"), SubResource("Resource_epdda"), SubResource("Resource_idh7b"), SubResource("Resource_yy8tc"), SubResource("Resource_yo5qr"), SubResource("Resource_7axnv"), SubResource("Resource_r3oqr"), SubResource("Resource_7hoak"), SubResource("Resource_x034i"), SubResource("Resource_hv6lt"), SubResource("Resource_ngwc0"), SubResource("Resource_dsk3l"), SubResource("Resource_efgi1"), SubResource("Resource_xenjc"), SubResource("Resource_2mijl"), SubResource("Resource_mucpl"), SubResource("Resource_dxffb"), SubResource("Resource_4c35o"), SubResource("Resource_4cd2u"), SubResource("Resource_ye22d"), SubResource("Resource_m18wr"), SubResource("Resource_jed2g"), SubResource("Resource_jel4s"), SubResource("Resource_tndbn"), SubResource("Resource_lufme"), SubResource("Resource_l53wn"), SubResource("Resource_clwx4"), SubResource("Resource_yficn"), SubResource("Resource_vm06g"), SubResource("Resource_goirg"), SubResource("Resource_ddf3p"), SubResource("Resource_uu0gn"), SubResource("Resource_4ysr1"), SubResource("Resource_6y6p0"), SubResource("Resource_1n48n"), SubResource("Resource_63rnc"), SubResource("Resource_0l6tr"), SubResource("Resource_inx16"), SubResource("Resource_mkuia"), SubResource("Resource_5kds2"), SubResource("Resource_iifks"), SubResource("Resource_8kl1j"), SubResource("Resource_278t0"), SubResource("Resource_c184q"), SubResource("Resource_cb0ow")])
[node name="ScrollContainer" type="ScrollContainer" parent="."]
layout_mode = 0

View File

@ -26,7 +26,7 @@ extends Node
@export var provide_summaries: bool = false
@export var allow_skipping: bool = false
# FIXME find a better way to switch fonts!
# FIXME find a better way to switch fonts and maybe emit the theme_changed signal!
var current_main_theme:Theme = preload("res://logic-scenes/themes/handwriting.theme")
@export_group("AudioSettings")
@ -140,6 +140,20 @@ func save_settings():
file.store_string(JSON.stringify(out_dict))
file.close()
var last_mode := DisplayServer.WINDOW_MODE_WINDOWED
func _unhandled_input(event: InputEvent) -> void:
#FIXME this can be removed when state no longer needs to be a tool
if not Engine.is_editor_hint():
if event.is_action_pressed("toggle_fullscreen"):
# I have no idea why I wrote thit as conviluted,
# but it works(TM) so I am not gonna change it :D
if DisplayServer.window_get_mode() == DisplayServer.WINDOW_MODE_FULLSCREEN:
DisplayServer.window_set_mode(last_mode)
else:
last_mode = DisplayServer.window_get_mode()
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
#endregion
func _ready():
@ -149,15 +163,18 @@ func _ready():
pass_stage_to(child)
break
music_volume = music_volume
#region focus handling (called staging to avoid name colisions)
# CAUTION: scene_reference directly accesses stage list to play sequences.
var stage_list:Array = []
var focus_locked: bool = false
# Intented for use when an actor wants focus for itself, can reclaim focus, thus dropping the stack that focused.
func take_stage(actor: Object, reclaim: bool = false) -> bool:
if focus_locked: return false
if focus_locked or Scenes.current_sequence != -1: return false
if reclaim:
stage_list.front().has_stage = false
if stage_list.has(actor):
@ -169,12 +186,11 @@ func take_stage(actor: Object, reclaim: bool = false) -> bool:
return pass_stage_to(actor)
# Element no longer wants focus, if Element itself is also dropped, this option can be chosen aswell.
func leave_stage(actor:Object, dropObject: bool = false) -> bool:
if get_tree().paused:
push_error(actor, " wanted to drop focus while tree is paused.")
func leave_stage(actor:Object) -> bool:
if not dropObject: actor.has_stage = false
focus_locked = false
if stage_list[0] == actor:
actor.has_stage = false
focus_locked = false
stage_list.erase(actor)
if stage_list != []:
@ -189,7 +205,7 @@ func get_current_actor(): return stage_list.front()
# Used to put a new target on top of the Focus Stack.
func pass_stage_to(target:Object, force = false, lock_focus = false) -> bool:
if "pass_to_actor" in target:
pass_stage_to(target.pass_to_actor)
return pass_stage_to(target.pass_to_actor)
if (focus_locked or get_tree().paused) and not force:
push_error(target, " requested focus while it was locked or tree is paused.")
elif !is_instance_valid(target):
@ -209,7 +225,7 @@ func pass_stage_to(target:Object, force = false, lock_focus = false) -> bool:
focus_locked = lock_focus
return true
return false
# Currently focused element loses focus, but remains in stack.
func free_focus():
if focus_locked: return false
@ -238,4 +254,19 @@ enum rooms {
ENDING
}
enum sequences {
DRAEVEN,
CHILDHOOD,
VOICE,
JUI_JUTSU,
TRANS,
AUTISM,
UNI_START,
VOLUNTARY,
UNI_CONTINUE,
UNI_ALT,
THERAPY,
BURNOUT
}
var current_room = rooms.MENU

View File

@ -1,11 +1,65 @@
extends Node
var sequence_actors:Array[Array] = []
var started_sequences: int = 0
var current_sequence: int = -1
var current_sequence_index: int = 0
enum id {
YOUTH_DRAEVEN,
YOUTH_CHILDHOOD,
YOUTH_VOICE_TRAINING,
YOUTH_JUI_JUTSU,
YOUTH_DRAEVEN,
ADULT_DND,
ADULD_VOLUNTARY,
ADULD_CHRISTMAS
}
signal scene_starting(scene_id: id, is_repeating: bool)
signal scene_continuing(scene_id: id, scene_index: int, is_repeating: bool)
signal scene_finished(scene_id: id, is_repeating: bool)
func _ready() -> void:
for i in range(id.keys().size()):
sequence_actors.append([null, null])
func sign_up_for_sequence(callable: Callable, sequence_id: id, index: int):
# if this assertion fails, two objects tried to sign up for the same sequence or an empty slot has been missing.
assert(sequence_actors[sequence_id][index] == null)
sequence_actors[sequence_id][index] = callable
func start_sequence(index: id):
if State.pass_stage_to(sequence_actors[index][0].get_object()):
sequence_actors[index][0].call(index)
current_sequence = index
started_sequences &= 1 << index
scene_starting.emit(current_sequence, is_sequence_repeating(index))
else:
push_error("Sequence could not be started.")
# Leaves stage to pass it to the next element wanting to catch focus.
func continue_sequence(former_actor: Object):
# if this fails, pass next was called without a sequencce having been started.
assert(current_sequence != -1)
if former_actor == State.stage_list[0] and former_actor == sequence_actors[current_sequence][current_sequence_index].get_object():
former_actor.has_stage = false
current_sequence_index += 1
State.stage_list[0] = sequence_actors[current_sequence][current_sequence_index].get_object()
print(sequence_actors[current_sequence][current_sequence_index].get_object().name)
State.stage_list[0].has_stage = true
sequence_actors[current_sequence][current_sequence_index].call(current_sequence, is_sequence_repeating(current_sequence))
scene_continuing.emit(current_sequence, current_sequence_index, is_sequence_repeating(current_sequence))
func end_current_sequence():
current_sequence = -1
current_sequence_index = 0
State.leave_stage(State.stage_list[0])
scene_finished.emit(current_sequence, is_sequence_repeating(current_sequence))
func is_sequence_repeating(index: int) -> bool: return started_sequences && 1 << index > 0