diff --git a/Music/Title.mp3 b/Music/Title.mp3 index 2f4e548a..c881c912 100644 --- a/Music/Title.mp3 +++ b/Music/Title.mp3 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:94569b819e590038fb38d08b5a10b114c8fe2b1999769a22c51dfd901a57108a -size 3443520 +oid sha256:f738e3862ef1ebbf4ffc74625e724e2432b460753d1cf635896557c02379ea2a +size 12522240 diff --git a/Resources/Debug/DebugLevels.tres b/Resources/Debug/DebugLevels.tres index a5514603..4db74fc8 100644 --- a/Resources/Debug/DebugLevels.tres +++ b/Resources/Debug/DebugLevels.tres @@ -19,7 +19,7 @@ _name = "Intro" [sub_resource type="Resource" id="Resource_cfhv5"] script = ExtResource("1_ov731") EggIndex = 0 -StartingEquipment = [] +StartingEquipment = Array[ExtResource("2_bkci5")]([]) [sub_resource type="Resource" id="Resource_0k62o"] script = ExtResource("2_tnajf") @@ -31,7 +31,7 @@ StartData = SubResource("Resource_cfhv5") [sub_resource type="Resource" id="Resource_tpb7s"] script = ExtResource("1_ov731") EggIndex = 0 -StartingEquipment = [] +StartingEquipment = Array[ExtResource("2_bkci5")]([]) [sub_resource type="Resource" id="Resource_edoov"] script = ExtResource("2_tnajf") @@ -43,7 +43,7 @@ StartData = SubResource("Resource_tpb7s") [sub_resource type="Resource" id="Resource_1sw5g"] script = ExtResource("1_ov731") EggIndex = 255 -StartingEquipment = [] +StartingEquipment = Array[ExtResource("2_bkci5")]([]) [sub_resource type="Resource" id="Resource_47bot"] script = ExtResource("2_tnajf") @@ -73,7 +73,7 @@ _name = "Rebel Base" [sub_resource type="Resource" id="Resource_maxpt"] script = ExtResource("1_ov731") EggIndex = 0 -StartingEquipment = [] +StartingEquipment = Array[ExtResource("2_bkci5")]([]) [sub_resource type="Resource" id="Resource_pein5"] script = ExtResource("2_tnajf") diff --git a/Resources/Styles/Title_Text_Style.tres b/Resources/Styles/Title_Text_Style.tres new file mode 100644 index 00000000..a5dab745 --- /dev/null +++ b/Resources/Styles/Title_Text_Style.tres @@ -0,0 +1,12 @@ +[gd_resource type="LabelSettings" load_steps=2 format=3 uid="uid://wr7cb2qa6w71"] + +[ext_resource type="FontFile" uid="uid://ccm3u37q1hvux" path="res://fonts/Xolonium-Regular.ttf" id="1_1ljef"] + +[resource] +line_spacing = 0.0 +font = ExtResource("1_1ljef") +font_size = 34 +outline_size = 8 +outline_color = Color(0, 0, 0, 1) +shadow_size = 9 +shadow_offset = Vector2(16, 16) diff --git a/Scenes/HUD/MusicRoom.tscn b/Scenes/HUD/MusicRoom.tscn new file mode 100644 index 00000000..285fac1b --- /dev/null +++ b/Scenes/HUD/MusicRoom.tscn @@ -0,0 +1,48 @@ +[gd_scene load_steps=5 format=3 uid="uid://c84shrj84g4t2"] + +[ext_resource type="Script" uid="uid://c06tspxwnj7pg" path="res://Scripts/UI/MusicRoom.cs" id="1_u3ui8"] +[ext_resource type="LabelSettings" uid="uid://wr7cb2qa6w71" path="res://Resources/Styles/Title_Text_Style.tres" id="1_w47yj"] +[ext_resource type="Theme" uid="uid://dnsadvmunm76k" path="res://Resources/Styles/MainMenuButtons.tres" id="2_rcbhv"] +[ext_resource type="Texture2D" uid="uid://bpd4ldfmt3s51" path="res://Sprites/UI/Note.png" id="3_u3ui8"] + +[node name="MusicRoom" type="VBoxContainer"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +script = ExtResource("1_u3ui8") + +[node name="Label" type="Label" parent="."] +layout_mode = 2 +text = "MUSIC ROOM" +label_settings = ExtResource("1_w47yj") +horizontal_alignment = 1 + +[node name="HBoxContainer" type="HBoxContainer" parent="."] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer"] +layout_mode = 2 + +[node name="Button" type="Button" parent="HBoxContainer/VBoxContainer"] +layout_mode = 2 +theme = ExtResource("2_rcbhv") +text = "Back" + +[node name="ItemList" type="ItemList" parent="HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme = ExtResource("2_rcbhv") +item_count = 4 +item_0/text = "Intro" +item_0/icon = ExtResource("3_u3ui8") +item_1/text = "No Reason" +item_1/icon = ExtResource("3_u3ui8") +item_2/text = "Level 1" +item_2/icon = ExtResource("3_u3ui8") +item_3/text = "Rumia" +item_3/icon = ExtResource("3_u3ui8") diff --git a/Scenes/MainMenu.tscn b/Scenes/MainMenu.tscn index 1bc456b9..c3ce43ce 100644 --- a/Scenes/MainMenu.tscn +++ b/Scenes/MainMenu.tscn @@ -1,26 +1,19 @@ -[gd_scene load_steps=13 format=3 uid="uid://5xajclchk3my"] +[gd_scene load_steps=15 format=3 uid="uid://5xajclchk3my"] [ext_resource type="Script" uid="uid://dql102fvubniv" path="res://Scripts/MainMenu.cs" id="1_702nk"] +[ext_resource type="PackedScene" uid="uid://c84shrj84g4t2" path="res://Scenes/HUD/MusicRoom.tscn" id="2_if7li"] [ext_resource type="Texture2D" uid="uid://xvadkvwajs0t" path="res://Sprites/UI/Crystal.png" id="2_j4e6a"] [ext_resource type="Texture2D" uid="uid://dicat7qqa0a7o" path="res://Sprites/Portraits/CirnoTitle.png" id="2_mpelb"] [ext_resource type="Texture2D" uid="uid://by38ufb51f6rx" path="res://Sprites/UI/TitleBackground.png" id="2_qdx0s"] [ext_resource type="FontFile" uid="uid://ccm3u37q1hvux" path="res://fonts/Xolonium-Regular.ttf" id="3_bl0se"] [ext_resource type="AudioStream" uid="uid://di416g5wgx6j0" path="res://Music/Title.mp3" id="4_i6ku4"] [ext_resource type="Theme" uid="uid://dnsadvmunm76k" path="res://Resources/Styles/MainMenuButtons.tres" id="4_nk7wn"] +[ext_resource type="LabelSettings" uid="uid://wr7cb2qa6w71" path="res://Resources/Styles/Title_Text_Style.tres" id="7_loo7a"] [ext_resource type="PackedScene" uid="uid://b3tyacxxw88lx" path="res://Scenes/Utils/StreamPlayerWithName.tscn" id="8_koqhg"] [ext_resource type="PackedScene" uid="uid://bemu3l6b1e84y" path="res://Scenes/HUD/debug_menu.tscn" id="9_nwlsr"] [sub_resource type="Theme" id="Theme_c7h4d"] -[sub_resource type="LabelSettings" id="LabelSettings_fb256"] -line_spacing = 0.0 -font = ExtResource("3_bl0se") -font_size = 34 -outline_size = 8 -outline_color = Color(0, 0, 0, 1) -shadow_size = 9 -shadow_offset = Vector2(16, 16) - [sub_resource type="LabelSettings" id="LabelSettings_htmja"] line_spacing = 2.0 font = ExtResource("3_bl0se") @@ -28,7 +21,10 @@ font_size = 12 outline_size = 4 outline_color = Color(0, 0, 0, 1) -[node name="Control" type="Control" node_paths=PackedStringArray("DebugMenuHolder")] +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_if7li"] +bg_color = Color(0, 0, 0, 0.760784) + +[node name="Control" type="Control" node_paths=PackedStringArray("SubMenuHolder")] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -40,8 +36,9 @@ grow_vertical = 2 script = ExtResource("1_702nk") GameScene = "res://Scenes/Maps/Tutorial.tscn" MainMenuScene = "res://Scenes/MainMenu.tscn" +SubMenuHolder = NodePath("SubMenuContainer") +MusicRoomTemplate = ExtResource("2_if7li") DebugMenuTemplate = ExtResource("9_nwlsr") -DebugMenuHolder = NodePath("Panel") [node name="TextureRect2" type="TextureRect" parent="."] layout_mode = 0 @@ -78,7 +75,13 @@ size_flags_vertical = 6 [node name="StartButton" type="Button" parent="MarginContainer/GridContainer/GameButtons"] layout_mode = 2 theme = ExtResource("4_nk7wn") -text = "Start" +text = "New +Game" + +[node name="DebugButton2" type="Button" parent="MarginContainer/GridContainer/GameButtons"] +layout_mode = 2 +theme = ExtResource("4_nk7wn") +text = "Continue" [node name="DebugButton" type="Button" parent="MarginContainer/GridContainer/GameButtons"] layout_mode = 2 @@ -107,7 +110,7 @@ theme = SubResource("Theme_c7h4d") theme_override_fonts/font = ExtResource("3_bl0se") theme_override_font_sizes/font_size = 28 text = "CIRNO" -label_settings = SubResource("LabelSettings_fb256") +label_settings = ExtResource("7_loo7a") horizontal_alignment = 1 [node name="Label2" type="Label" parent="MarginContainer/GridContainer/Title/VBoxContainer"] @@ -128,25 +131,39 @@ stretch_mode = 2 layout_mode = 2 size_flags_vertical = 6 -[node name="Button" type="Button" parent="MarginContainer/GridContainer/Options"] +[node name="OptionsButton" type="Button" parent="MarginContainer/GridContainer/Options"] layout_mode = 2 theme = ExtResource("4_nk7wn") text = "Options" +[node name="MusicRoomButton" type="Button" parent="MarginContainer/GridContainer/Options"] +layout_mode = 2 +theme = ExtResource("4_nk7wn") +text = "Music +Room" + +[node name="CreditsButton" type="Button" parent="MarginContainer/GridContainer/Options"] +layout_mode = 2 +theme = ExtResource("4_nk7wn") +text = "Credits" + [node name="AudioStreamPlayer2D" parent="." instance=ExtResource("8_koqhg")] stream = ExtResource("4_i6ku4") autoplay = true -TrackName = "Main Menu" +TrackName = "No Reason" AuthorName = "Fenekhu" -[node name="Panel" type="PanelContainer" parent="."] +[node name="SubMenuContainer" type="PanelContainer" parent="."] visible = false layout_mode = 0 -offset_left = 66.0 -offset_top = 45.0 -offset_right = 259.0 +offset_left = 13.0 +offset_top = 23.0 +offset_right = 312.0 offset_bottom = 156.0 +theme_override_styles/panel = SubResource("StyleBoxFlat_if7li") [connection signal="pressed" from="MarginContainer/GridContainer/GameButtons/StartButton" to="." method="_on_start_button_pressed"] +[connection signal="pressed" from="MarginContainer/GridContainer/GameButtons/DebugButton2" to="." method="_on_debug_button_pressed"] [connection signal="pressed" from="MarginContainer/GridContainer/GameButtons/DebugButton" to="." method="_on_debug_button_pressed"] [connection signal="pressed" from="MarginContainer/GridContainer/GameButtons/ExitButton" to="." method="_on_exit_button_pressed"] +[connection signal="pressed" from="MarginContainer/GridContainer/Options/MusicRoomButton" to="." method="_on_music_room_button_pressed"] diff --git a/Scenes/test.tscn b/Scenes/test.tscn index a9d8fc92..1b36cb86 100644 --- a/Scenes/test.tscn +++ b/Scenes/test.tscn @@ -474,7 +474,7 @@ SpawnMarkers = Dictionary[int, NodePath]({ 255: NodePath("Factory Tilemaps/Debug Room/DebugRoomStartPosition") }) WeaponTemplate = ExtResource("3_2wlhc") -StartingEquipment = [ExtResource("4_swym2"), ExtResource("5_nqier")] +StartingEquipment = Array[ExtResource("6_8tdlb")]([ExtResource("4_swym2"), ExtResource("5_nqier")]) MapStartData = SubResource("Resource_6sau4") metadata/_edit_lock_ = true diff --git a/Scripts/Hud.cs b/Scripts/Hud.cs index 9e5a884c..976bd4d9 100644 --- a/Scripts/Hud.cs +++ b/Scripts/Hud.cs @@ -290,7 +290,7 @@ public partial class Hud : CanvasLayer DebugMenuHolder.CallDeferred("add_child", menu); - menu.DebugMenuClosed += () => + menu.MenuClosed += () => { DebugMenuHolder.Visible = false; SpawnPauseMenu(); diff --git a/Scripts/MainMenu.cs b/Scripts/MainMenu.cs index 87a5af0d..81d327c5 100644 --- a/Scripts/MainMenu.cs +++ b/Scripts/MainMenu.cs @@ -10,13 +10,17 @@ public partial class MainMenu : Control [Export] public string MainMenuScene { get; set; } - [ExportGroup("Debug Menu")] + [Export] + public Control SubMenuHolder { get; set; } = new Control(); + + [ExportCategory("Music Room")] + [Export] + public PackedScene MusicRoomTemplate { get; set; } + + [ExportCategory("Debug Menu")] [Export] public PackedScene DebugMenuTemplate { get; set; } - - [ExportGroup("Debug Menu")] - [Export] - public Control DebugMenuHolder { get; set; } + // Called when the node enters the scene tree for the first time. public override void _Ready() @@ -38,22 +42,50 @@ public partial class MainMenu : Control private void _on_debug_button_pressed() { - if (DebugMenuTemplate is null || DebugMenuHolder is null) return; - DebugMenuHolder.Visible = true; + SpawnMenu(DebugMenuTemplate, SubMenuHolder); + + // if (DebugMenuTemplate is null || DebugMenuHolder is null) return; + // DebugMenuHolder.Visible = true; - var children = DebugMenuHolder.GetChildren(); + // var children = DebugMenuHolder.GetChildren(); + // foreach (var child in children) + // { + // child.QueueFree(); + // } + + // var menu = DebugMenuTemplate.Instantiate(); + + // DebugMenuHolder.CallDeferred("add_child", menu); + + // menu.DebugMenuClosed += () => + // { + // DebugMenuHolder.Visible = false; + // }; + } + + private void _on_music_room_button_pressed() + { + SpawnMenu(MusicRoomTemplate, SubMenuHolder); + } + + private void SpawnMenu(PackedScene template, Control holder) where T : MenuBase + { + if (template is null || holder is null) return; + holder.Visible = true; + + var children = holder.GetChildren(); foreach (var child in children) { child.QueueFree(); } - var menu = DebugMenuTemplate.Instantiate(); + var menu = template.Instantiate(); - DebugMenuHolder.CallDeferred("add_child", menu); + holder.CallDeferred("add_child", menu); - menu.DebugMenuClosed += () => + menu.MenuClosed += () => { - DebugMenuHolder.Visible = false; + holder.Visible = false; }; } diff --git a/Scripts/UI/DebugMenu.cs b/Scripts/UI/DebugMenu.cs index 419664c8..5e13261d 100644 --- a/Scripts/UI/DebugMenu.cs +++ b/Scripts/UI/DebugMenu.cs @@ -5,7 +5,7 @@ using Cirno.Scripts.Resources.DebugMenu; using Godot.Collections; using DebugMapSelectData = Cirno.Scripts.Resources.DebugMenu.DebugMapSelectData; -public partial class DebugMenu : Control +public partial class DebugMenu : MenuBase { [Export] @@ -17,9 +17,6 @@ public partial class DebugMenu : Control [Export] public Container ButtonsContainer { get; private set; } - [Signal] - public delegate void DebugMenuClosedEventHandler(); - // Called when the node enters the scene tree for the first time. public override void _Ready() { @@ -52,7 +49,7 @@ public partial class DebugMenu : Control { this.QueueFree(); - EmitSignal(SignalName.DebugMenuClosed); + EmitSignal(SignalName.MenuClosed); } // Called every frame. 'delta' is the elapsed time since the previous frame. diff --git a/Scripts/UI/MenuBase.cs b/Scripts/UI/MenuBase.cs new file mode 100644 index 00000000..45570608 --- /dev/null +++ b/Scripts/UI/MenuBase.cs @@ -0,0 +1,12 @@ + +using Godot; +using System; +using Cirno.Scripts.Resources; +using Cirno.Scripts.Resources.DebugMenu; +using Godot.Collections; + +public partial class MenuBase : Control +{ + [Signal] + public delegate void MenuClosedEventHandler(); +} \ No newline at end of file diff --git a/Scripts/UI/MenuBase.cs.uid b/Scripts/UI/MenuBase.cs.uid new file mode 100644 index 00000000..545347dc --- /dev/null +++ b/Scripts/UI/MenuBase.cs.uid @@ -0,0 +1 @@ +uid://jyqs08gi37of diff --git a/Scripts/UI/MusicRoom.cs b/Scripts/UI/MusicRoom.cs new file mode 100644 index 00000000..65bc3964 --- /dev/null +++ b/Scripts/UI/MusicRoom.cs @@ -0,0 +1,5 @@ + +public partial class MusicRoom : MenuBase +{ + +} \ No newline at end of file diff --git a/Scripts/UI/MusicRoom.cs.uid b/Scripts/UI/MusicRoom.cs.uid new file mode 100644 index 00000000..84975483 --- /dev/null +++ b/Scripts/UI/MusicRoom.cs.uid @@ -0,0 +1 @@ +uid://c06tspxwnj7pg