diff --git a/src/base-environments/youth_room/youth_room.tscn b/src/base-environments/youth_room/youth_room.tscn index 81b688e..e53aa03 100644 --- a/src/base-environments/youth_room/youth_room.tscn +++ b/src/base-environments/youth_room/youth_room.tscn @@ -2039,6 +2039,8 @@ volume_db = -80.0 bus = &"music" [node name="childhood" parent="logic/ScenePlayer" instance=ExtResource("12_viwxf")] +story_array = [] +paragraph_lengths = [1] [node name="VoiceTraining" type="AudioStreamPlayer" parent="logic/ScenePlayer"] stream = ExtResource("10_wwwdq") @@ -2048,11 +2050,15 @@ bus = &"music" [node name="JuiJutsu" parent="logic/ScenePlayer" instance=ExtResource("12_x3dlb")] [node name="voice_training" parent="logic/ScenePlayer" instance=ExtResource("13_v3447")] +story_array = [] +paragraph_lengths = [1] [node name="Jui_Jutsu" type="AudioStreamPlayer" parent="logic/ScenePlayer"] bus = &"music" [node name="draven" parent="logic/ScenePlayer" instance=ExtResource("19_d3c7p")] +story_array = [] +paragraph_lengths = [1] [node name="starlight_mesh" type="MeshInstance3D" parent="logic/ScenePlayer"] transform = Transform3D(0.999, 0, 0, 0, 0.999, 0, 0, 0, 0.999, 0, 0, 0) diff --git a/src/logic-scenes/board/card-board.gd b/src/logic-scenes/board/card-board.gd index 2822d32..f0aacf9 100644 --- a/src/logic-scenes/board/card-board.gd +++ b/src/logic-scenes/board/card-board.gd @@ -23,7 +23,7 @@ var focus_stickies:bool = true: else: current_dropzone_id = current_dropzone_id -var has_stage = false: +var has_stage := false: set(focus): if focus: has_stage = true diff --git a/src/logic-scenes/boot/boot.gd b/src/logic-scenes/boot/boot.gd index 61510e1..67c7ece 100644 --- a/src/logic-scenes/boot/boot.gd +++ b/src/logic-scenes/boot/boot.gd @@ -1 +1,6 @@ extends Node + +# General housekeeping to set up a "normal" +# game experience, e.g. +# - ensure settings exist +# - ensure savegames are healthy diff --git a/src/singletons/main/main.gd b/src/singletons/main/main.gd index d3e89e3..939f92b 100644 --- a/src/singletons/main/main.gd +++ b/src/singletons/main/main.gd @@ -1,184 +1,184 @@ -extends Node3D +extends Control signal room_loaded -var has_stage: bool = false: - set(stage): - has_stage = stage - if in_game and has_stage: - in_game = false - _return_to_menu() +var has_stage: bool = false +# set(stage): +# has_stage = stage +# if in_game and has_stage: +# in_game = false +# _return_to_menu() @export_file(".tscn") var youth_room_path: String @export_file(".tscn") var transition_room_path: String @export_file(".tscn") var adulthood_room_path: String @export_file(".tscn") var ending_path: String -@onready var main_menu:MainMenu = %"Main Menu" +@onready var main_menu:MainMenu = %MainMenu @onready var pause_menu = %PauseMenu @onready var menu_animation: AnimationTree = %MenuAnimationTree @onready var state_machine = menu_animation["parameters/playback"] -@onready var focus_forward = %"Main Menu" - -var current_room_id: State.rooms - -var in_game = false - -var current_room: RoomTemplate -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 - else: - menu_animation["parameters/conditions/loading_done"] = true - menu_animation["parameters/conditions/load_save"] = false - - currently_loading_room = path - -# Called when the node enters the scene tree for the first time. -func _ready(): - main_menu.start_game.connect(load_save) - main_menu.roll_credits.connect(func(): state_machine.travel("credits_roll")) - get_tree().tree_process_mode_changed.connect(pause_mode_changed) - await get_tree().process_frame - currently_loading_room = get_room_path_from_id(main_menu.save_game_handle.get_most_recent_save().current_room) - State.pass_stage_to(main_menu) - - Scenes.scene_starting.connect(prepare_transition) - Scenes.scene_finished.connect(transition) - -func _process(_delta: float) -> void: - if currently_loading_room != "" and not await_swap: - if ResourceLoader.load_threaded_get_status(currently_loading_room) == 3: - if not current_room == null: - current_room.queue_free() - State.onready_room = get_room_id_from_path(currently_loading_room) - current_room = ResourceLoader.load_threaded_get(currently_loading_room).instantiate() - print("add room") - add_child(current_room) - State.onready_room = State.rooms.NULL - move_child(current_room, 0) - currently_loading_room = "" - room_loaded.emit() - - if Input.is_action_just_pressed("reset_demo") and (OS.has_feature("demo") or true): - State.stage_list = [self] - _return_to_menu() - -func _unhandled_input(event: InputEvent) -> void: - if event is InputEvent and in_game: - if event.is_action_pressed("ui_menu"): - toggle_pause_menu() +@onready var focus_forward = %MainMenu +# +#var in_game = false +# +#var current_room: RoomTemplate +#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 +# else: +# menu_animation["parameters/conditions/loading_done"] = true +# menu_animation["parameters/conditions/load_save"] = false +# +# currently_loading_room = path +# +## Called when the node enters the scene tree for the first time. +#func _ready(): +# main_menu.start_game.connect(load_save) +# main_menu.roll_credits.connect(func(): state_machine.travel("credits_roll")) +# get_tree().tree_process_mode_changed.connect(pause_mode_changed) +# await get_tree().process_frame +# currently_loading_room = get_room_path_from_id(main_menu.save_game_handle.get_most_recent_save().current_room) +# State.pass_stage_to(main_menu) +# +# Scenes.scene_starting.connect(prepare_transition) +# Scenes.scene_finished.connect(transition) +# +#func _process(_delta: float) -> void: +# if currently_loading_room != "" and not await_swap: +# if ResourceLoader.load_threaded_get_status(currently_loading_room) == 3: +# if not current_room == null: +# current_room.queue_free() +# State.onready_room = get_room_id_from_path(currently_loading_room) +# current_room = ResourceLoader.load_threaded_get(currently_loading_room).instantiate() +# print("add room") +# add_child(current_room) +# State.onready_room = State.rooms.NULL +# move_child(current_room, 0) +# currently_loading_room = "" +# room_loaded.emit() +# +# if Input.is_action_just_pressed("reset_demo") and (OS.has_feature("demo") or true): +# State.stage_list = [self] +# _return_to_menu() +# +#func _unhandled_input(event: InputEvent) -> void: +# if event is InputEvent and in_game: +# if event.is_action_pressed("ui_menu"): +# toggle_pause_menu() +# func toggle_pause_menu(): - if not get_tree().paused: - get_tree().paused = true - var state_machine = menu_animation["parameters/playback"] - state_machine.travel("reveal_pause_menu") - Input.mouse_mode = Input.MOUSE_MODE_VISIBLE - else: - get_tree().paused = false - var state_machine = menu_animation["parameters/playback"] - state_machine.travel("start_game") + pass +# if not get_tree().paused: +# get_tree().paused = true +# var state_machine := menu_animation["parameters/playback"] +# state_machine.travel("reveal_pause_menu") +# Input.mouse_mode = Input.MOUSE_MODE_VISIBLE +# else: +# get_tree().paused = false +# var state_machine := menu_animation["parameters/playback"] +# state_machine.travel("start_game") +# +# if State.stage_list[0] is Player: +# Input.mouse_mode = Input.MOUSE_MODE_CAPTURED - if State.stage_list[0] is Player: - Input.mouse_mode = Input.MOUSE_MODE_CAPTURED - -func debug_youth(): - get_child(1).hide() - get_child(2).hide() - get_child(3).hide() - get_child(0).get_ready() - get_child(0).start() - -func _return_to_menu(): - State.active_save_game = null - - menu_animation["parameters/conditions/start_game"] = false - - State.pass_stage_to(main_menu) - - currently_loading_room = get_room_path_from_id(main_menu.save_game_handle.get_most_recent_save().current_room) - - menu_animation["parameters/conditions/return_to_menu"] = true - await(get_tree().create_timer(0.5).timeout) - menu_animation["parameters/conditions/return_to_menu"] = false - _on_ready_to_unload() - -func load_save(save: SaveGame): - - if currently_loading_room != "": - await(room_loaded) - - if save.current_room != current_room.id: - # TODO Prevent race condition from appearing when save is loaded while room is still loading. - currently_loading_room = get_room_path_from_id(save.current_room) - await(room_loaded) - - menu_animation["parameters/conditions/start_game"] = true - - State.active_save_game = save - in_game = true - current_room.start_room() - -func _on_ready_to_unload(): - if get_child(0) is Node3D: - get_child(0).free() - -func get_room_path_from_id(id: State.rooms) -> String: - match id: - State.rooms.YOUTH, State.rooms.NULL: - return youth_room_path - State.rooms.TRANSITION: - return transition_room_path - State.rooms.ADULTHOOD: - return adulthood_room_path - _: - return ending_path - -func get_room_id_from_path(path: String) -> State.rooms: - match path: - youth_room_path: - return State.rooms.YOUTH - transition_room_path: - return State.rooms.TRANSITION - adulthood_room_path: - return State.rooms.ADULTHOOD - _: - return State.rooms.NULL - - -func start_demo(): - #FIXME this causes the room to reload - #load_save(SaveGame.new()) - current_room.start_room() - in_game = true - -func pause_mode_changed(): - print(get_tree().paused) - -var await_swap: bool = false -func prepare_transition(scene_id: Scenes.id, _repeat): - if scene_id == Scenes.id.TRANSITION: - await_swap = true - #FIXME: this does not need to be part of the sequence - await(get_tree().process_frame) - current_room.prepare_transition() - if not _repeat: - currently_loading_room = get_room_path_from_id(State.rooms.TRANSITION) - else: - - currently_loading_room = get_room_path_from_id(State.rooms.ADULTHOOD) - -func transition(scene_id: Scenes.id, _repeat): - if scene_id == Scenes.id.TRANSITION: - State.reset_focus() - await_swap = false - await room_loaded - if not _repeat: - State.queue_for_stage(current_room) - Scenes.end_current_sequence() - else: - State.pass_stage_to(current_room) +#func debug_youth(): +# get_child(1).hide() +# get_child(2).hide() +# get_child(3).hide() +# get_child(0).get_ready() +# get_child(0).start() +# +#func _return_to_menu(): +# State.active_save_game = null +# +# menu_animation["parameters/conditions/start_game"] = false +# +# State.pass_stage_to(main_menu) +# +# currently_loading_room = get_room_path_from_id(main_menu.save_game_handle.get_most_recent_save().current_room) +# +# menu_animation["parameters/conditions/return_to_menu"] = true +# await(get_tree().create_timer(0.5).timeout) +# menu_animation["parameters/conditions/return_to_menu"] = false +# _on_ready_to_unload() +# +#func load_save(save: SaveGame): +# +# if currently_loading_room != "": +# await(room_loaded) +# +# if save.current_room != current_room.id: +# # TODO Prevent race condition from appearing when save is loaded while room is still loading. +# currently_loading_room = get_room_path_from_id(save.current_room) +# await(room_loaded) +# +# menu_animation["parameters/conditions/start_game"] = true +# +# State.active_save_game = save +# in_game = true +# current_room.start_room() +# +#func _on_ready_to_unload(): +# if get_child(0) is Node3D: +# get_child(0).free() +# +#func get_room_path_from_id(id: State.rooms) -> String: +# match id: +# State.rooms.YOUTH, State.rooms.NULL: +# return youth_room_path +# State.rooms.TRANSITION: +# return transition_room_path +# State.rooms.ADULTHOOD: +# return adulthood_room_path +# _: +# return ending_path +# +#func get_room_id_from_path(path: String) -> State.rooms: +# match path: +# youth_room_path: +# return State.rooms.YOUTH +# transition_room_path: +# return State.rooms.TRANSITION +# adulthood_room_path: +# return State.rooms.ADULTHOOD +# _: +# return State.rooms.NULL +# +# +#func start_demo(): +# #FIXME this causes the room to reload +# #load_save(SaveGame.new()) +# current_room.start_room() +# in_game = true +# +#func pause_mode_changed(): +# print(get_tree().paused) +# +#var await_swap: bool = false +#func prepare_transition(scene_id: Scenes.id, _repeat): +# if scene_id == Scenes.id.TRANSITION: +# await_swap = true +# #FIXME: this does not need to be part of the sequence +# await(get_tree().process_frame) +# current_room.prepare_transition() +# if not _repeat: +# currently_loading_room = get_room_path_from_id(State.rooms.TRANSITION) +# else: +# +# currently_loading_room = get_room_path_from_id(State.rooms.ADULTHOOD) +# +#func transition(scene_id: Scenes.id, _repeat): +# if scene_id == Scenes.id.TRANSITION: +# State.reset_focus() +# await_swap = false +# await room_loaded +# if not _repeat: +# State.queue_for_stage(current_room) +# Scenes.end_current_sequence() +# else: +# State.pass_stage_to(current_room) diff --git a/src/singletons/main/main.tscn b/src/singletons/main/main.tscn index 3538846..28f1228 100644 --- a/src/singletons/main/main.tscn +++ b/src/singletons/main/main.tscn @@ -20,6 +20,30 @@ [ext_resource type="Script" uid="uid://dfr1w7u3jgni3" path="res://addons/markdownlabel/header_formats/h5_format.gd" id="18_d13ii"] [ext_resource type="Script" uid="uid://bsi6dexoofpe6" path="res://addons/markdownlabel/header_formats/h6_format.gd" id="19_1u8w0"] +[sub_resource type="Resource" id="Resource_0odxb"] +resource_local_to_scene = true +script = ExtResource("14_cegan") + +[sub_resource type="Resource" id="Resource_lswn8"] +resource_local_to_scene = true +script = ExtResource("15_82xsv") + +[sub_resource type="Resource" id="Resource_a6jrf"] +resource_local_to_scene = true +script = ExtResource("16_getpj") + +[sub_resource type="Resource" id="Resource_xuqvo"] +resource_local_to_scene = true +script = ExtResource("17_ryguw") + +[sub_resource type="Resource" id="Resource_qsp4k"] +resource_local_to_scene = true +script = ExtResource("18_d13ii") + +[sub_resource type="Resource" id="Resource_kq58d"] +resource_local_to_scene = true +script = ExtResource("19_1u8w0") + [sub_resource type="GDScript" id="GDScript_8sq0u"] script/source = "extends Label @@ -119,7 +143,7 @@ tracks/4/keys = { tracks/5/type = "value" tracks/5/imported = false tracks/5/enabled = true -tracks/5/path = NodePath("../../Main Menu:modulate") +tracks/5/path = NodePath("../../MainMenu:modulate") tracks/5/interp = 1 tracks/5/loop_wrap = true tracks/5/keys = { @@ -131,7 +155,7 @@ tracks/5/keys = { tracks/6/type = "value" tracks/6/imported = false tracks/6/enabled = true -tracks/6/path = NodePath("../../Main Menu:visible") +tracks/6/path = NodePath("../../MainMenu:visible") tracks/6/interp = 1 tracks/6/loop_wrap = true tracks/6/keys = { @@ -203,7 +227,7 @@ tracks/11/keys = { tracks/12/type = "value" tracks/12/imported = false tracks/12/enabled = true -tracks/12/path = NodePath("%Main Menu:visible") +tracks/12/path = NodePath("../../MainMenu:visible") tracks/12/interp = 1 tracks/12/loop_wrap = true tracks/12/keys = { @@ -215,7 +239,7 @@ tracks/12/keys = { tracks/13/type = "value" tracks/13/imported = false tracks/13/enabled = true -tracks/13/path = NodePath("%Main Menu:modulate") +tracks/13/path = NodePath("../../MainMenu:modulate") tracks/13/interp = 1 tracks/13/loop_wrap = true tracks/13/keys = { @@ -303,7 +327,7 @@ length = 130.003 tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true -tracks/0/path = NodePath("../../Main Menu:visible") +tracks/0/path = NodePath("../../MainMenu:visible") tracks/0/interp = 0 tracks/0/loop_wrap = true tracks/0/keys = { @@ -390,7 +414,7 @@ tracks/6/keys = { tracks/7/type = "value" tracks/7/imported = false tracks/7/enabled = true -tracks/7/path = NodePath("%Main Menu:modulate") +tracks/7/path = NodePath("../../MainMenu:modulate") tracks/7/interp = 1 tracks/7/loop_wrap = true tracks/7/keys = { @@ -454,7 +478,7 @@ tracks/3/keys = { tracks/4/type = "value" tracks/4/imported = false tracks/4/enabled = true -tracks/4/path = NodePath("%Main Menu:visible") +tracks/4/path = NodePath("../../MainMenu:visible") tracks/4/interp = 1 tracks/4/loop_wrap = true tracks/4/keys = { @@ -494,7 +518,7 @@ tracks/1/keys = { tracks/2/type = "value" tracks/2/imported = false tracks/2/enabled = true -tracks/2/path = NodePath("%Main Menu:visible") +tracks/2/path = NodePath("../../MainMenu:visible") tracks/2/interp = 1 tracks/2/loop_wrap = true tracks/2/keys = { @@ -506,7 +530,7 @@ tracks/2/keys = { tracks/3/type = "value" tracks/3/imported = false tracks/3/enabled = true -tracks/3/path = NodePath("%Main Menu:modulate") +tracks/3/path = NodePath("../../MainMenu:modulate") tracks/3/interp = 1 tracks/3/loop_wrap = true tracks/3/keys = { @@ -683,7 +707,7 @@ tracks/4/keys = { tracks/5/type = "value" tracks/5/imported = false tracks/5/enabled = true -tracks/5/path = NodePath("../../Main Menu:modulate") +tracks/5/path = NodePath("../../MainMenu:modulate") tracks/5/interp = 1 tracks/5/loop_wrap = true tracks/5/keys = { @@ -907,7 +931,7 @@ tracks/3/keys = { tracks/4/type = "value" tracks/4/imported = false tracks/4/enabled = true -tracks/4/path = NodePath("%Main Menu:visible") +tracks/4/path = NodePath("../../MainMenu:visible") tracks/4/interp = 1 tracks/4/loop_wrap = true tracks/4/keys = { @@ -935,7 +959,7 @@ tracks/0/keys = { tracks/1/type = "value" tracks/1/imported = false tracks/1/enabled = true -tracks/1/path = NodePath("%Main Menu:modulate") +tracks/1/path = NodePath("../../MainMenu:modulate") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/keys = { @@ -947,7 +971,7 @@ tracks/1/keys = { tracks/2/type = "value" tracks/2/imported = false tracks/2/enabled = true -tracks/2/path = NodePath("%Main Menu:visible") +tracks/2/path = NodePath("../../MainMenu:visible") tracks/2/interp = 1 tracks/2/loop_wrap = true tracks/2/keys = { @@ -974,7 +998,7 @@ tracks/0/keys = { tracks/1/type = "value" tracks/1/imported = false tracks/1/enabled = true -tracks/1/path = NodePath("../../Main Menu:modulate") +tracks/1/path = NodePath("../../MainMenu:modulate") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/keys = { @@ -986,7 +1010,7 @@ tracks/1/keys = { tracks/2/type = "value" tracks/2/imported = false tracks/2/enabled = true -tracks/2/path = NodePath("../../Main Menu:visible") +tracks/2/path = NodePath("../../MainMenu:visible") tracks/2/interp = 1 tracks/2/loop_wrap = true tracks/2/keys = { @@ -1145,7 +1169,7 @@ states/reveal_pause_menu/position = Vector2(783.91, -112.734) states/start_game/node = SubResource("AnimationNodeAnimation_5umfs") states/start_game/position = Vector2(698, 32) transitions = ["Start", "init", SubResource("AnimationNodeStateMachineTransition_dxdg4"), "init", "loading", SubResource("AnimationNodeStateMachineTransition_0hpxy"), "loading", "loading_done", SubResource("AnimationNodeStateMachineTransition_ipapo"), "loading_done", "start_game", SubResource("AnimationNodeStateMachineTransition_0t1lp"), "start_game", "init", SubResource("AnimationNodeStateMachineTransition_66nmg"), "loading_done", "load_savegame", SubResource("AnimationNodeStateMachineTransition_6b86u"), "load_savegame", "loading_game", SubResource("AnimationNodeStateMachineTransition_y626i"), "loading_game", "start_game", SubResource("AnimationNodeStateMachineTransition_52bss"), "start_game", "credits_roll", SubResource("AnimationNodeStateMachineTransition_x8oth"), "credits_roll", "loading_done", SubResource("AnimationNodeStateMachineTransition_5ge3a"), "loading_done", "credits_roll", SubResource("AnimationNodeStateMachineTransition_44pd3"), "start_game", "reveal_pause_menu", SubResource("AnimationNodeStateMachineTransition_pc6pe"), "reveal_pause_menu", "hide_pause_menu", SubResource("AnimationNodeStateMachineTransition_dx61n"), "hide_pause_menu", "start_game", SubResource("AnimationNodeStateMachineTransition_lp1dx"), "hide_pause_menu", "init", SubResource("AnimationNodeStateMachineTransition_mqlnh")] -graph_offset = Vector2(-306.25, -187.73401) +graph_offset = Vector2(144.75, -210.73401) [sub_resource type="Shader" id="Shader_cegan"] code = "shader_type canvas_item; @@ -1211,32 +1235,14 @@ fill = 1 fill_from = Vector2(0.538462, 0.491453) fill_to = Vector2(1.3, -0.3) -[sub_resource type="Resource" id="Resource_0odxb"] -resource_local_to_scene = true -script = ExtResource("14_cegan") - -[sub_resource type="Resource" id="Resource_lswn8"] -resource_local_to_scene = true -script = ExtResource("15_82xsv") - -[sub_resource type="Resource" id="Resource_a6jrf"] -resource_local_to_scene = true -script = ExtResource("16_getpj") - -[sub_resource type="Resource" id="Resource_xuqvo"] -resource_local_to_scene = true -script = ExtResource("17_ryguw") - -[sub_resource type="Resource" id="Resource_qsp4k"] -resource_local_to_scene = true -script = ExtResource("18_d13ii") - -[sub_resource type="Resource" id="Resource_kq58d"] -resource_local_to_scene = true -script = ExtResource("19_1u8w0") - -[node name="main" type="Node3D"] +[node name="main" type="Control"] process_mode = 3 +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 script = ExtResource("1_rqkns") youth_room_path = "res://base-environments/youth_room/youth_room.tscn" transition_room_path = "uid://fgp3s28h7msy" @@ -1245,6 +1251,7 @@ adulthood_room_path = "uid://flisupth27th" [node name="Panel" type="Panel" parent="."] visible = false modulate = Color(0, 0, 0, 1) +layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 @@ -1252,158 +1259,17 @@ grow_horizontal = 2 grow_vertical = 2 mouse_filter = 2 -[node name="Main Menu" parent="." instance=ExtResource("3_ik73t")] -unique_name_in_owner = true - -[node name="FPSLabel" type="Label" parent="."] -visible = false -offset_right = 40.0 -offset_bottom = 35.0 -script = SubResource("GDScript_8sq0u") - -[node name="Startup Menu" parent="." instance=ExtResource("1_v5rpm")] -visible = false - -[node name="Disclaimer" parent="." instance=ExtResource("7_t45fc")] -visible = false - -[node name="Control" type="Control" parent="."] -layout_mode = 3 -anchors_preset = 2 -anchor_top = 1.0 -anchor_bottom = 1.0 -offset_top = -40.0 -offset_right = 40.0 -grow_vertical = 0 - -[node name="mask" type="Sprite2D" parent="Control"] -modulate = Color(1, 1, 1, 0) -clip_children = 1 -position = Vector2(98, -47) -rotation = 1.5708 -texture = ExtResource("5_sr555") - -[node name="frame" type="Sprite2D" parent="Control/mask"] -clip_children = 1 -texture = ExtResource("6_aaaxa") - -[node name="deco" type="Sprite2D" parent="Control/mask/frame"] -modulate = Color(1, 1, 1, 0) -rotation = -0.314159 -texture = ExtResource("7_koraw") - -[node name="LoadingLabel" type="Label" parent="Control"] -visible = false -layout_mode = 0 -offset_left = 100.0 -offset_top = -37.0 -offset_right = 239.99973 -offset_bottom = 9.0 -text = "loading" -script = SubResource("GDScript_cegan") - -[node name="MenuAnimationPlayer" type="AnimationPlayer" parent="."] -unique_name_in_owner = true -root_node = NodePath("../Control/mask") -libraries = { -&"": SubResource("AnimationLibrary_ogbs1") -} -autoplay = "init" - -[node name="MenuAnimationTree" type="AnimationTree" parent="MenuAnimationPlayer"] -unique_name_in_owner = true -root_node = NodePath("%MenuAnimationPlayer/../Control/mask") -tree_root = SubResource("AnimationNodeStateMachine_uwcb5") -anim_player = NodePath("..") -parameters/conditions/load_save = false -parameters/conditions/loading_done = false -parameters/conditions/return_to_menu = false -parameters/conditions/roll_credits = false -parameters/conditions/start_game = false - -[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="MenuAnimationPlayer/MenuAnimationTree"] -bus = &"music" - -[node name="PauseContainer" type="CenterContainer" parent="."] -visible = false -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 - -[node name="TextureRect" type="TextureRect" parent="PauseContainer"] -material = SubResource("ShaderMaterial_knlqd") -layout_mode = 2 -texture = SubResource("GradientTexture2D_swtmc") - -[node name="PauseMenu" type="PanelContainer" parent="PauseContainer"] -unique_name_in_owner = true -layout_mode = 2 -script = ExtResource("9_ihfph") - -[node name="VBoxContainer" type="VBoxContainer" parent="PauseContainer/PauseMenu"] -modulate = Color(1, 1, 1, 0) -layout_mode = 2 - -[node name="Label" type="Label" parent="PauseContainer/PauseMenu/VBoxContainer"] -layout_mode = 2 -theme_type_variation = &"HeaderLarge" -text = "Game Paused" - -[node name="ResumeButton" type="Button" parent="PauseContainer/PauseMenu/VBoxContainer"] -unique_name_in_owner = true -layout_mode = 2 -text = "Resume" - -[node name="BugButton" type="Button" parent="PauseContainer/PauseMenu/VBoxContainer"] -layout_mode = 2 -script = ExtResource("12_cegan") -metadata/_custom_type_script = "uid://sa15wakvpj2e" - -[node name="ToMenuButton" type="Button" parent="PauseContainer/PauseMenu/VBoxContainer"] -unique_name_in_owner = true -visible = false -layout_mode = 2 -text = "Return to Menu" - -[node name="ToSettingsButton" type="Button" parent="PauseContainer/PauseMenu/VBoxContainer"] -unique_name_in_owner = true -visible = false -layout_mode = 2 -text = "Open Settings" - -[node name="ToDesktopButton" type="Button" parent="PauseContainer/PauseMenu/VBoxContainer"] -unique_name_in_owner = true -layout_mode = 2 -text = "Quit to Desktop" - -[node name="HSeparator" type="HSeparator" parent="PauseContainer/PauseMenu/VBoxContainer"] -custom_minimum_size = Vector2(0, 20) -layout_mode = 2 - -[node name="FindHelplineButton" type="Button" parent="PauseContainer/PauseMenu/VBoxContainer"] -unique_name_in_owner = true -layout_mode = 2 -text = "Find Help-Lines" - -[node name="Label2" type="Label" parent="PauseContainer/PauseMenu/VBoxContainer"] -layout_mode = 2 -text = "opens findahelpline.com" -horizontal_alignment = 1 - -[node name="SkipStoryButton" type="Button" parent="PauseContainer/PauseMenu/VBoxContainer"] -unique_name_in_owner = true -visible = false -layout_mode = 2 -text = "Skip this Story" - [node name="CreditsRoll" type="RichTextLabel" parent="."] visible = false modulate = Color(1, 1, 1, 0) +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 offset_top = 220.0 -offset_right = 1926.0 -offset_bottom = 5260.0 +offset_bottom = 3502.0 +grow_horizontal = 2 +grow_vertical = 2 bbcode_enabled = true text = "[center] [img=512]res://ui/menu_main/logo.png[/img] @@ -1645,4 +1511,153 @@ h4 = SubResource("Resource_xuqvo") h5 = SubResource("Resource_qsp4k") h6 = SubResource("Resource_kq58d") +[node name="MainMenu" parent="." instance=ExtResource("3_ik73t")] +unique_name_in_owner = true +layout_mode = 1 + +[node name="FPSLabel" type="Label" parent="."] +visible = false +layout_mode = 0 +offset_right = 40.0 +offset_bottom = 35.0 +script = SubResource("GDScript_8sq0u") + +[node name="Startup Menu" parent="." instance=ExtResource("1_v5rpm")] +visible = false +layout_mode = 1 + +[node name="Disclaimer" parent="." instance=ExtResource("7_t45fc")] +visible = false +layout_mode = 1 + +[node name="Loading" type="Control" parent="."] +layout_mode = 1 +anchors_preset = 2 +anchor_top = 1.0 +anchor_bottom = 1.0 +grow_vertical = 0 + +[node name="mask" type="Sprite2D" parent="Loading"] +modulate = Color(1, 1, 1, 0) +clip_children = 1 +position = Vector2(98, -47) +rotation = 1.5708 +texture = ExtResource("5_sr555") + +[node name="frame" type="Sprite2D" parent="Loading/mask"] +clip_children = 1 +texture = ExtResource("6_aaaxa") + +[node name="deco" type="Sprite2D" parent="Loading/mask/frame"] +modulate = Color(1, 1, 1, 0) +rotation = -0.314159 +texture = ExtResource("7_koraw") + +[node name="LoadingLabel" type="Label" parent="Loading"] +visible = false +layout_mode = 0 +offset_left = 100.0 +offset_top = -37.0 +offset_right = 239.99976 +offset_bottom = 9.0 +text = "loading" +script = SubResource("GDScript_cegan") + +[node name="MenuAnimationPlayer" type="AnimationPlayer" parent="."] +unique_name_in_owner = true +root_node = NodePath("../Loading/mask") +libraries = { +&"": SubResource("AnimationLibrary_ogbs1") +} +autoplay = "init" + +[node name="MenuAnimationTree" type="AnimationTree" parent="MenuAnimationPlayer"] +unique_name_in_owner = true +root_node = NodePath("%MenuAnimationPlayer/../Loading/mask") +tree_root = SubResource("AnimationNodeStateMachine_uwcb5") +anim_player = NodePath("..") +parameters/conditions/load_save = false +parameters/conditions/loading_done = false +parameters/conditions/return_to_menu = false +parameters/conditions/roll_credits = false +parameters/conditions/start_game = false + +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="MenuAnimationPlayer/MenuAnimationTree"] +bus = &"music" + +[node name="PauseContainer" type="CenterContainer" parent="."] +visible = false +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="TextureRect" type="TextureRect" parent="PauseContainer"] +material = SubResource("ShaderMaterial_knlqd") +layout_mode = 2 +texture = SubResource("GradientTexture2D_swtmc") + +[node name="PauseMenu" type="PanelContainer" parent="PauseContainer"] +unique_name_in_owner = true +layout_mode = 2 +script = ExtResource("9_ihfph") + +[node name="VBoxContainer" type="VBoxContainer" parent="PauseContainer/PauseMenu"] +modulate = Color(1, 1, 1, 0) +layout_mode = 2 + +[node name="Label" type="Label" parent="PauseContainer/PauseMenu/VBoxContainer"] +layout_mode = 2 +theme_type_variation = &"HeaderLarge" +text = "Game Paused" + +[node name="ResumeButton" type="Button" parent="PauseContainer/PauseMenu/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "Resume" + +[node name="BugButton" type="Button" parent="PauseContainer/PauseMenu/VBoxContainer"] +layout_mode = 2 +script = ExtResource("12_cegan") +metadata/_custom_type_script = "uid://sa15wakvpj2e" + +[node name="ToMenuButton" type="Button" parent="PauseContainer/PauseMenu/VBoxContainer"] +unique_name_in_owner = true +visible = false +layout_mode = 2 +text = "Return to Menu" + +[node name="ToSettingsButton" type="Button" parent="PauseContainer/PauseMenu/VBoxContainer"] +unique_name_in_owner = true +visible = false +layout_mode = 2 +text = "Open Settings" + +[node name="ToDesktopButton" type="Button" parent="PauseContainer/PauseMenu/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "Quit to Desktop" + +[node name="HSeparator" type="HSeparator" parent="PauseContainer/PauseMenu/VBoxContainer"] +custom_minimum_size = Vector2(0, 20) +layout_mode = 2 + +[node name="FindHelplineButton" type="Button" parent="PauseContainer/PauseMenu/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +text = "Find Help-Lines" + +[node name="Label2" type="Label" parent="PauseContainer/PauseMenu/VBoxContainer"] +layout_mode = 2 +text = "opens findahelpline.com" +horizontal_alignment = 1 + +[node name="SkipStoryButton" type="Button" parent="PauseContainer/PauseMenu/VBoxContainer"] +unique_name_in_owner = true +visible = false +layout_mode = 2 +text = "Skip this Story" + [connection signal="on_read" from="Disclaimer" to="Startup Menu" method="starting"] diff --git a/src/ui/menu_main/gameplay_settings.gd b/src/ui/menu_main/gameplay_settings.gd index a8075d8..d69e9e6 100644 --- a/src/ui/menu_main/gameplay_settings.gd +++ b/src/ui/menu_main/gameplay_settings.gd @@ -25,14 +25,14 @@ func _ready() -> void: input_sensitivity_slider.value_changed.connect(func(value): State.input_sensitivity = value) stream_overlay_picker.item_selected.connect(func(value): State.stream_overlay = value) fov_slider.value_changed.connect(func(value): State.input_sensitivity = value) - + %SaveButton.pressed.connect(_on_exit_button_pressed) func update_ui_from_state(): y_switch_gamepad.button_pressed = State.inverty_y_axis input_sensitivity_slider.value = State.input_sensitivity stream_overlay_picker.select(State.stream_overlay_position) - + func _on_exit_button_pressed() -> void: leave_stage.emit() State.save_settings() diff --git a/src/ui/menu_main/main_menu.tscn b/src/ui/menu_main/main_menu.tscn index e8ad71a..6668c74 100644 --- a/src/ui/menu_main/main_menu.tscn +++ b/src/ui/menu_main/main_menu.tscn @@ -253,7 +253,7 @@ _data = { &"vanish": SubResource("Animation_a3iyq") } -[node name="Main Menu" type="Panel"] +[node name="MainMenu" type="Panel"] anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0