Added pause menu

This commit is contained in:
2025-10-19 00:30:13 +03:00
parent ba81352133
commit 83b14d31cd
20 changed files with 301 additions and 60 deletions
+13 -17
View File
@@ -2,41 +2,37 @@
[ext_resource type="Script" uid="uid://dclkpithyykju" path="res://menu/credits.gd" id="1_wp78b"]
[node name="Credits" type="Node"]
script = ExtResource("1_wp78b")
[node name="Control" type="Control" parent="."]
[node name="Credits" type="Control"]
layout_mode = 3
anchors_preset = 0
script = ExtResource("1_wp78b")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 0
offset_left = 100.0
offset_top = 100.0
offset_right = 140.0
offset_bottom = 140.0
offset_right = 330.0
offset_bottom = 158.0
[node name="VBoxContainer" type="VBoxContainer" parent="Control"]
layout_mode = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="GridContainer" type="GridContainer" parent="Control/VBoxContainer"]
[node name="GridContainer" type="GridContainer" parent="VBoxContainer"]
layout_mode = 2
columns = 2
[node name="ProgrammingLabel" type="Label" parent="Control/VBoxContainer/GridContainer"]
[node name="ProgrammingLabel" type="Label" parent="VBoxContainer/GridContainer"]
layout_mode = 2
text = "Programming:"
horizontal_alignment = 2
[node name="ProgrammersLabel" type="Label" parent="Control/VBoxContainer/GridContainer"]
[node name="ProgrammersLabel" type="Label" parent="VBoxContainer/GridContainer"]
layout_mode = 2
text = "Ruslan Ignatov"
[node name="HBoxContainer" type="HBoxContainer" parent="Control/VBoxContainer"]
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
layout_mode = 2
alignment = 2
[node name="MainMenuButton" type="Button" parent="Control/VBoxContainer/HBoxContainer"]
[node name="MainMenuButton" type="Button" parent="VBoxContainer/HBoxContainer"]
layout_mode = 2
text = "Main Menu"
[connection signal="pressed" from="Control/VBoxContainer/HBoxContainer/MainMenuButton" to="." method="_on_main_menu_button_pressed"]
[connection signal="pressed" from="VBoxContainer/HBoxContainer/MainMenuButton" to="." method="_on_main_menu_button_pressed"]
+11 -15
View File
@@ -2,40 +2,36 @@
[ext_resource type="Script" uid="uid://dixdfabe2vfsj" path="res://menu/main_menu.gd" id="1_chmv6"]
[node name="MainMenu" type="Node"]
script = ExtResource("1_chmv6")
[node name="Control" type="Control" parent="."]
[node name="MainMenu" type="Control"]
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
script = ExtResource("1_chmv6")
[node name="VBoxContainer" type="VBoxContainer" parent="Control"]
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 0
offset_left = 100.0
offset_top = 100.0
offset_right = 179.0
offset_bottom = 236.0
[node name="ContinueButton" type="Button" parent="Control/VBoxContainer"]
[node name="ContinueButton" type="Button" parent="VBoxContainer"]
layout_mode = 2
disabled = true
text = "Continue"
[node name="StartButton" type="Button" parent="Control/VBoxContainer"]
[node name="StartButton" type="Button" parent="VBoxContainer"]
layout_mode = 2
text = "Start"
[node name="OptionsButton" type="Button" parent="Control/VBoxContainer"]
[node name="OptionsButton" type="Button" parent="VBoxContainer"]
layout_mode = 2
text = "Options"
[node name="QuitButton" type="Button" parent="Control/VBoxContainer"]
[node name="QuitButton" type="Button" parent="VBoxContainer"]
layout_mode = 2
text = "Quit"
[connection signal="pressed" from="Control/VBoxContainer/ContinueButton" to="." method="_on_continue_button_pressed"]
[connection signal="pressed" from="Control/VBoxContainer/StartButton" to="." method="_on_start_button_pressed"]
[connection signal="pressed" from="Control/VBoxContainer/OptionsButton" to="." method="_on_options_button_pressed"]
[connection signal="pressed" from="Control/VBoxContainer/QuitButton" to="." method="_on_quit_button_pressed"]
[connection signal="pressed" from="VBoxContainer/ContinueButton" to="." method="_on_continue_button_pressed"]
[connection signal="pressed" from="VBoxContainer/StartButton" to="." method="_on_start_button_pressed"]
[connection signal="pressed" from="VBoxContainer/OptionsButton" to="." method="_on_options_button_pressed"]
[connection signal="pressed" from="VBoxContainer/QuitButton" to="." method="_on_quit_button_pressed"]
+2 -2
View File
@@ -3,8 +3,8 @@ extends Node
signal show_credits
signal show_main_menu
@onready var fullscreen_check := $Control/VBoxContainer/OptionsGridContainer/FullscreenCheckButton
@onready var window_factor := $Control/VBoxContainer/OptionsGridContainer/WindowFactorOptionButton
@onready var fullscreen_check := $%FullscreenCheckButton
@onready var window_factor := $%WindowFactorOptionButton
func _ready() -> void:
+21 -23
View File
@@ -2,39 +2,37 @@
[ext_resource type="Script" uid="uid://ceng1u112aqg0" path="res://menu/options.gd" id="1_61pji"]
[node name="Options" type="Node"]
script = ExtResource("1_61pji")
[node name="Control" type="Control" parent="."]
[node name="Options" type="Control"]
layout_mode = 3
anchors_preset = 0
script = ExtResource("1_61pji")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 0
offset_left = 100.0
offset_top = 100.0
offset_right = 140.0
offset_bottom = 140.0
[node name="VBoxContainer" type="VBoxContainer" parent="Control"]
layout_mode = 0
offset_right = 40.0
offset_bottom = 40.0
offset_right = 271.0
offset_bottom = 194.0
alignment = 1
[node name="OptionsGridContainer" type="GridContainer" parent="Control/VBoxContainer"]
[node name="OptionsGridContainer" type="GridContainer" parent="VBoxContainer"]
layout_mode = 2
columns = 2
[node name="FullscreenLabel" type="Label" parent="Control/VBoxContainer/OptionsGridContainer"]
[node name="FullscreenLabel" type="Label" parent="VBoxContainer/OptionsGridContainer"]
layout_mode = 2
text = "Fullscreen"
[node name="FullscreenCheckButton" type="CheckButton" parent="Control/VBoxContainer/OptionsGridContainer"]
[node name="FullscreenCheckButton" type="CheckButton" parent="VBoxContainer/OptionsGridContainer"]
unique_name_in_owner = true
layout_mode = 2
[node name="WindowFactorLabel" type="Label" parent="Control/VBoxContainer/OptionsGridContainer"]
[node name="WindowFactorLabel" type="Label" parent="VBoxContainer/OptionsGridContainer"]
layout_mode = 2
text = "Window Factor"
[node name="WindowFactorOptionButton" type="OptionButton" parent="Control/VBoxContainer/OptionsGridContainer"]
[node name="WindowFactorOptionButton" type="OptionButton" parent="VBoxContainer/OptionsGridContainer"]
unique_name_in_owner = true
layout_mode = 2
selected = 0
item_count = 6
@@ -51,19 +49,19 @@ popup/item_4/id = 4
popup/item_5/text = "×6"
popup/item_5/id = 5
[node name="HBoxContainer" type="HBoxContainer" parent="Control/VBoxContainer"]
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
layout_mode = 2
alignment = 2
[node name="CreditsButton" type="Button" parent="Control/VBoxContainer/HBoxContainer"]
[node name="CreditsButton" type="Button" parent="VBoxContainer/HBoxContainer"]
layout_mode = 2
text = "Credits"
[node name="BackButton" type="Button" parent="Control/VBoxContainer/HBoxContainer"]
[node name="BackButton" type="Button" parent="VBoxContainer/HBoxContainer"]
layout_mode = 2
text = "Back"
[connection signal="toggled" from="Control/VBoxContainer/OptionsGridContainer/FullscreenCheckButton" to="." method="_on_fullscreen_check_button_toggled"]
[connection signal="item_selected" from="Control/VBoxContainer/OptionsGridContainer/WindowFactorOptionButton" to="." method="_on_window_factor_option_button_item_selected"]
[connection signal="pressed" from="Control/VBoxContainer/HBoxContainer/CreditsButton" to="." method="_on_credits_button_pressed"]
[connection signal="pressed" from="Control/VBoxContainer/HBoxContainer/BackButton" to="." method="_on_back_button_pressed"]
[connection signal="toggled" from="VBoxContainer/OptionsGridContainer/FullscreenCheckButton" to="." method="_on_fullscreen_check_button_toggled"]
[connection signal="item_selected" from="VBoxContainer/OptionsGridContainer/WindowFactorOptionButton" to="." method="_on_window_factor_option_button_item_selected"]
[connection signal="pressed" from="VBoxContainer/HBoxContainer/CreditsButton" to="." method="_on_credits_button_pressed"]
[connection signal="pressed" from="VBoxContainer/HBoxContainer/BackButton" to="." method="_on_back_button_pressed"]
+12
View File
@@ -0,0 +1,12 @@
extends Node
signal continue_game
signal show_main_menu
func _on_continue_button_pressed() -> void:
continue_game.emit()
func _on_main_menu_button_pressed() -> void:
show_main_menu.emit()
+1
View File
@@ -0,0 +1 @@
uid://npqs2m5g5bd6
+26
View File
@@ -0,0 +1,26 @@
[gd_scene load_steps=2 format=3 uid="uid://bclo2wl8ibrcg"]
[ext_resource type="Script" uid="uid://npqs2m5g5bd6" path="res://menu/pause_menu.gd" id="1_inj1j"]
[node name="PauseMenu" type="Control"]
layout_mode = 3
anchors_preset = 0
script = ExtResource("1_inj1j")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 0
offset_left = 100.0
offset_top = 100.0
offset_right = 196.0
offset_bottom = 166.0
[node name="ContinueButton" type="Button" parent="VBoxContainer"]
layout_mode = 2
text = "Continue"
[node name="MainMenuButton" type="Button" parent="VBoxContainer"]
layout_mode = 2
text = "Main Menu"
[connection signal="pressed" from="VBoxContainer/ContinueButton" to="." method="_on_continue_button_pressed"]
[connection signal="pressed" from="VBoxContainer/MainMenuButton" to="." method="_on_main_menu_button_pressed"]