mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-16 06:43:46 +00:00
Debug menu
This commit is contained in:
parent
5b2b11545a
commit
778dc10d9a
7 changed files with 143 additions and 6 deletions
|
|
@ -10,5 +10,6 @@
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANode_002Ecs_002Fl_003AC_0021_003FUsers_003FMaddo_003FAppData_003FLocal_003FJetBrains_003FShared_003FvAny_003FSourcesCache_003Fbb1b701f3c7411227a9d2e09f965d857ff3e771557650c4f513e427d77c_003FNode_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANode_002Ecs_002Fl_003AC_0021_003FUsers_003FMaddo_003FAppData_003FLocal_003FJetBrains_003FShared_003FvAny_003FSourcesCache_003Fbb1b701f3c7411227a9d2e09f965d857ff3e771557650c4f513e427d77c_003FNode_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APlayerMovement_005FScriptMethods_002Egenerated_002Ecs_002Fl_003AC_0021_003FUsers_003FMaddo_003FAppData_003FLocal_003FJetBrains_003FShared_003FvAny_003FSourcesCache_003F4af4702ac4bbb9ab7299554c41beea2bf703b4a_003FPlayerMovement_005FScriptMethods_002Egenerated_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APlayerMovement_005FScriptMethods_002Egenerated_002Ecs_002Fl_003AC_0021_003FUsers_003FMaddo_003FAppData_003FLocal_003FJetBrains_003FShared_003FvAny_003FSourcesCache_003F4af4702ac4bbb9ab7299554c41beea2bf703b4a_003FPlayerMovement_005FScriptMethods_002Egenerated_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AScriptManagerBridge_002Ecs_002Fl_003AC_0021_003FUsers_003FMaddo_003FAppData_003FLocal_003FJetBrains_003FShared_003FvAny_003FDecompilerCache_003Fdecompiler_003F4fd22cd129a84c16b5d8004b467c426f518800_003F3a_003Fc456f450_003FScriptManagerBridge_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AScriptManagerBridge_002Ecs_002Fl_003AC_0021_003FUsers_003FMaddo_003FAppData_003FLocal_003FJetBrains_003FShared_003FvAny_003FDecompilerCache_003Fdecompiler_003F4fd22cd129a84c16b5d8004b467c426f518800_003F3a_003Fc456f450_003FScriptManagerBridge_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AThrowHelpers_002Ecs_002Fl_003AC_0021_003FUsers_003FMaddo_003FAppData_003FLocal_003FJetBrains_003FShared_003FvAny_003FSourcesCache_003Fbb2a94dce7ca55a596694df58d3ca91c6d9c9c9c9813775e4d1abd0f91dc59_003FThrowHelpers_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AVariantUtils_002Ecs_002Fl_003AC_0021_003FUsers_003FMaddo_003FAppData_003FLocal_003FJetBrains_003FShared_003FvAny_003FDecompilerCache_003Fdecompiler_003F4fd22cd129a84c16b5d8004b467c426f518800_003F38_003Fb04c4423_003FVariantUtils_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AVariantUtils_002Ecs_002Fl_003AC_0021_003FUsers_003FMaddo_003FAppData_003FLocal_003FJetBrains_003FShared_003FvAny_003FDecompilerCache_003Fdecompiler_003F4fd22cd129a84c16b5d8004b467c426f518800_003F38_003Fb04c4423_003FVariantUtils_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AVector2_002Ecs_002Fl_003AC_0021_003FUsers_003FMaddo_003FAppData_003FLocal_003FJetBrains_003FShared_003FvAny_003FDecompilerCache_003Fdecompiler_003F08f0ea1144634eedbe3a87b9762ef1dd4bd200_003F85_003F367e08bf_003FVector2_002Ecs/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AVector2_002Ecs_002Fl_003AC_0021_003FUsers_003FMaddo_003FAppData_003FLocal_003FJetBrains_003FShared_003FvAny_003FDecompilerCache_003Fdecompiler_003F08f0ea1144634eedbe3a87b9762ef1dd4bd200_003F85_003F367e08bf_003FVector2_002Ecs/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>
|
||||||
45
Scenes/HUD/debug_menu.tscn
Normal file
45
Scenes/HUD/debug_menu.tscn
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
[gd_scene load_steps=7 format=3 uid="uid://bemu3l6b1e84y"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://Scripts/UI/DebugMenu.cs" id="1_5vtnj"]
|
||||||
|
[ext_resource type="Theme" uid="uid://dnsadvmunm76k" path="res://Resources/Styles/MainMenuButtons.tres" id="2_wqb8e"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bv451a8wgty4u" path="res://Scenes/test.tscn" id="3_nd4do"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://c4yvclwjr2g3s" path="res://Scenes/naviogation_test.tscn" id="4_sxmbn"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bu5fvatj2j08j" path="res://Scenes/Maps/BossTestArena.tscn" id="5_jms4h"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bx31ou6tw3kd1" path="res://Scenes/Maps/RebelBase.tscn" id="6_4c6m4"]
|
||||||
|
|
||||||
|
[node name="DebugMenu" type="VBoxContainer" node_paths=PackedStringArray("ButtonsContainer")]
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
script = ExtResource("1_5vtnj")
|
||||||
|
ButtonTheme = ExtResource("2_wqb8e")
|
||||||
|
Levels = Array[PackedScene]([ExtResource("3_nd4do"), ExtResource("4_sxmbn"), ExtResource("5_jms4h"), ExtResource("6_4c6m4")])
|
||||||
|
ButtonsContainer = NodePath("Level Select")
|
||||||
|
|
||||||
|
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="CheckBox" type="CheckBox" parent="HBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
theme = ExtResource("2_wqb8e")
|
||||||
|
theme_override_font_sizes/font_size = 14
|
||||||
|
text = "Skip Dialogues"
|
||||||
|
|
||||||
|
[node name="God Mode" type="CheckBox" parent="HBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
theme = ExtResource("2_wqb8e")
|
||||||
|
theme_override_font_sizes/font_size = 14
|
||||||
|
text = "God Mode
|
||||||
|
"
|
||||||
|
|
||||||
|
[node name="Level Select" type="FlowContainer" parent="."]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="BackButton" type="Button" parent="Level Select"]
|
||||||
|
layout_mode = 2
|
||||||
|
theme = ExtResource("2_wqb8e")
|
||||||
|
text = "Back"
|
||||||
|
|
||||||
|
[connection signal="pressed" from="Level Select/BackButton" to="." method="_on_back_button_pressed"]
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=12 format=3 uid="uid://5xajclchk3my"]
|
[gd_scene load_steps=13 format=3 uid="uid://5xajclchk3my"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://Scripts/MainMenu.cs" id="1_702nk"]
|
[ext_resource type="Script" path="res://Scripts/MainMenu.cs" id="1_702nk"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bv451a8wgty4u" path="res://Scenes/test.tscn" id="2_6rjfu"]
|
[ext_resource type="PackedScene" uid="uid://bv451a8wgty4u" path="res://Scenes/test.tscn" id="2_6rjfu"]
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
[ext_resource type="FontFile" uid="uid://ccm3u37q1hvux" path="res://fonts/Xolonium-Regular.ttf" id="3_bl0se"]
|
[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="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="Theme" uid="uid://dnsadvmunm76k" path="res://Resources/Styles/MainMenuButtons.tres" id="4_nk7wn"]
|
||||||
|
[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="Theme" id="Theme_c7h4d"]
|
||||||
|
|
||||||
|
|
@ -27,7 +28,7 @@ font_size = 12
|
||||||
outline_size = 4
|
outline_size = 4
|
||||||
outline_color = Color(0, 0, 0, 1)
|
outline_color = Color(0, 0, 0, 1)
|
||||||
|
|
||||||
[node name="Control" type="Control"]
|
[node name="Control" type="Control" node_paths=PackedStringArray("DebugMenuHolder")]
|
||||||
layout_mode = 3
|
layout_mode = 3
|
||||||
anchors_preset = 15
|
anchors_preset = 15
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
|
|
@ -39,6 +40,8 @@ grow_vertical = 2
|
||||||
script = ExtResource("1_702nk")
|
script = ExtResource("1_702nk")
|
||||||
GameScene = ExtResource("2_6rjfu")
|
GameScene = ExtResource("2_6rjfu")
|
||||||
MainMenuScene = "res://Scenes/MainMenu.tscn"
|
MainMenuScene = "res://Scenes/MainMenu.tscn"
|
||||||
|
DebugMenuTemplate = ExtResource("9_nwlsr")
|
||||||
|
DebugMenuHolder = NodePath("Panel")
|
||||||
|
|
||||||
[node name="TextureRect2" type="TextureRect" parent="."]
|
[node name="TextureRect2" type="TextureRect" parent="."]
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
|
|
@ -134,6 +137,14 @@ text = "Options"
|
||||||
stream = ExtResource("4_i6ku4")
|
stream = ExtResource("4_i6ku4")
|
||||||
autoplay = true
|
autoplay = true
|
||||||
|
|
||||||
|
[node name="Panel" type="PanelContainer" parent="."]
|
||||||
|
visible = false
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 66.0
|
||||||
|
offset_top = 45.0
|
||||||
|
offset_right = 259.0
|
||||||
|
offset_bottom = 156.0
|
||||||
|
|
||||||
[connection signal="pressed" from="MarginContainer/GridContainer/GameButtons/StartButton" to="." method="_on_start_button_pressed"]
|
[connection signal="pressed" from="MarginContainer/GridContainer/GameButtons/StartButton" to="." method="_on_start_button_pressed"]
|
||||||
[connection signal="pressed" from="MarginContainer/GridContainer/GameButtons/DebugButton" 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/GameButtons/ExitButton" to="." method="_on_exit_button_pressed"]
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,9 @@ public partial class GameManager : Node2D
|
||||||
|
|
||||||
GameState = GameState.Playing;
|
GameState = GameState.Playing;
|
||||||
|
|
||||||
_ = DelayPlayerSpawn();
|
//_ = DelayPlayerSpawn();
|
||||||
|
|
||||||
|
CallDeferred(nameof(DelayPlayerSpawn));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
|
@ -78,9 +80,9 @@ public partial class GameManager : Node2D
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task DelayPlayerSpawn()
|
private void DelayPlayerSpawn()
|
||||||
{
|
{
|
||||||
await Task.Delay(500);
|
//await Task.Delay(500);
|
||||||
|
|
||||||
if (PlayerSpawnMarker != null)
|
if (PlayerSpawnMarker != null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,12 @@ public partial class MainMenu : Control
|
||||||
[Export]
|
[Export]
|
||||||
public string MainMenuScene { get; set; }
|
public string MainMenuScene { get; set; }
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
public PackedScene DebugMenuTemplate { get; set; }
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
public Control DebugMenuHolder { get; set; }
|
||||||
|
|
||||||
// Called when the node enters the scene tree for the first time.
|
// Called when the node enters the scene tree for the first time.
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
|
|
@ -29,7 +35,26 @@ public partial class MainMenu : Control
|
||||||
|
|
||||||
private void _on_debug_button_pressed()
|
private void _on_debug_button_pressed()
|
||||||
{
|
{
|
||||||
|
if (DebugMenuTemplate is not null && DebugMenuHolder is not null)
|
||||||
|
{
|
||||||
|
DebugMenuHolder.Visible = true;
|
||||||
|
|
||||||
|
var children = DebugMenuHolder.GetChildren();
|
||||||
|
foreach (var child in children)
|
||||||
|
{
|
||||||
|
child.QueueFree();
|
||||||
|
}
|
||||||
|
|
||||||
|
var menu = DebugMenuTemplate.Instantiate<DebugMenu>();
|
||||||
|
|
||||||
|
DebugMenuHolder.CallDeferred("add_child", menu);
|
||||||
|
|
||||||
|
menu.DebugMenuClosed += () =>
|
||||||
|
{
|
||||||
|
DebugMenuHolder.Visible = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void _on_mainmenu_button_pressed()
|
private void _on_mainmenu_button_pressed()
|
||||||
|
|
|
||||||
53
Scripts/UI/DebugMenu.cs
Normal file
53
Scripts/UI/DebugMenu.cs
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
using Godot;
|
||||||
|
using System;
|
||||||
|
using Godot.Collections;
|
||||||
|
|
||||||
|
public partial class DebugMenu : Control
|
||||||
|
{
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
public Theme ButtonTheme { get; private set; }
|
||||||
|
|
||||||
|
[Export]
|
||||||
|
public Array<PackedScene> Levels { get; private set; }
|
||||||
|
|
||||||
|
[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()
|
||||||
|
{
|
||||||
|
foreach (var level in Levels)
|
||||||
|
{
|
||||||
|
var button = new Button();
|
||||||
|
button.Text = level.ResourcePath.Split("/")[^1].Split(".")[0];
|
||||||
|
button.Theme = ButtonTheme;
|
||||||
|
|
||||||
|
ButtonsContainer.CallDeferred("add_child", button);
|
||||||
|
|
||||||
|
button.Pressed += () => ButtonOnPressed(level);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonOnPressed(PackedScene scene)
|
||||||
|
{
|
||||||
|
GD.Print("Button was pressed, now what");
|
||||||
|
GetTree().ChangeSceneToFile(scene.ResourcePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void _on_back_button_pressed()
|
||||||
|
{
|
||||||
|
this.QueueFree();
|
||||||
|
|
||||||
|
EmitSignal(SignalName.DebugMenuClosed);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
public override void _Process(double delta)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -21,7 +21,7 @@ Settings/temporaryLogLifetime=5.0
|
||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="Cirno"
|
config/name="Cirno"
|
||||||
run/main_scene="res://Scenes/test.tscn"
|
run/main_scene="res://Scenes/MainMenu.tscn"
|
||||||
config/features=PackedStringArray("4.3", "C#", "GL Compatibility")
|
config/features=PackedStringArray("4.3", "C#", "GL Compatibility")
|
||||||
config/icon="res://icon.svg"
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue