2025-05-05 00:11:49 +02:00
|
|
|
[gd_scene load_steps=5 format=3 uid="uid://dkxtwpcy4moyo"]
|
|
|
|
|
|
|
|
[ext_resource type="Theme" uid="uid://c6ceauyc42c33" path="res://menus/menu.tres" id="1_s0u37"]
|
2025-04-23 15:37:03 +02:00
|
|
|
|
|
|
|
[sub_resource type="GDScript" id="GDScript_d8v8v"]
|
|
|
|
script/source = "extends Control
|
|
|
|
|
|
|
|
signal request_pause
|
|
|
|
signal request_restart
|
2025-05-05 00:11:49 +02:00
|
|
|
signal request_quit
|
|
|
|
|
|
|
|
var settings_menu_scene := preload(\"res://menus/settings_menu.tscn\")
|
2025-04-23 15:37:03 +02:00
|
|
|
|
|
|
|
func _ready() -> void:
|
|
|
|
var os_name = OS.get_name()
|
|
|
|
if os_name == \"Web\": ## you can't quit the game on web (you're stuck here forever :))
|
|
|
|
$VBoxContainer/Btn_Quit.hide()
|
|
|
|
|
|
|
|
func _input(_event: InputEvent) -> void:
|
|
|
|
if Input.is_action_just_pressed(\"pause_game\"):
|
|
|
|
request_pause.emit(!self.visible)
|
|
|
|
|
|
|
|
func _on_btn_resume_pressed() -> void:
|
|
|
|
request_pause.emit(false)
|
|
|
|
|
|
|
|
func _on_btn_restart_pressed() -> void:
|
|
|
|
request_restart.emit()
|
|
|
|
|
2025-05-05 00:11:49 +02:00
|
|
|
func _on_btn_settings_pressed() -> void:
|
|
|
|
var settings := settings_menu_scene.instantiate()
|
|
|
|
settings.connect(\"return_to_pause_menu\", exit_settings)
|
|
|
|
$SettingsContainer.add_child(settings)
|
|
|
|
$SettingsContainer.show()
|
|
|
|
|
|
|
|
func exit_settings() -> void:
|
|
|
|
$SettingsContainer.hide()
|
|
|
|
for child in $SettingsContainer.get_children():
|
|
|
|
child.queue_free()
|
|
|
|
|
2025-04-23 15:37:03 +02:00
|
|
|
func _on_btn_quit_pressed() -> void:
|
2025-05-05 00:11:49 +02:00
|
|
|
request_quit.emit()
|
2025-04-23 15:37:03 +02:00
|
|
|
"
|
|
|
|
|
2025-05-05 00:11:49 +02:00
|
|
|
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_s0u37"]
|
|
|
|
bg_color = Color(0.268015, 0.649122, 0.807649, 1)
|
|
|
|
skew = Vector2(-0.1, 0.05)
|
|
|
|
border_width_left = 5
|
|
|
|
border_width_top = 5
|
|
|
|
border_width_right = 5
|
|
|
|
border_width_bottom = 5
|
|
|
|
border_color = Color(1, 1, 1, 1)
|
|
|
|
corner_radius_top_left = 12
|
|
|
|
corner_radius_top_right = 12
|
|
|
|
corner_radius_bottom_right = 12
|
|
|
|
corner_radius_bottom_left = 12
|
|
|
|
expand_margin_left = 20.0
|
|
|
|
expand_margin_top = 8.0
|
|
|
|
expand_margin_right = 20.0
|
|
|
|
|
|
|
|
[sub_resource type="LabelSettings" id="LabelSettings_s0u37"]
|
|
|
|
font_size = 48
|
|
|
|
outline_size = 8
|
|
|
|
outline_color = Color(0, 0, 0, 1)
|
|
|
|
|
2025-04-23 15:37:03 +02:00
|
|
|
[node name="PauseMenu" type="Control"]
|
|
|
|
z_index = 2
|
|
|
|
layout_mode = 3
|
|
|
|
anchors_preset = 15
|
|
|
|
anchor_right = 1.0
|
|
|
|
anchor_bottom = 1.0
|
|
|
|
grow_horizontal = 2
|
|
|
|
grow_vertical = 2
|
|
|
|
mouse_filter = 1
|
2025-05-05 00:11:49 +02:00
|
|
|
theme = ExtResource("1_s0u37")
|
2025-04-23 15:37:03 +02:00
|
|
|
script = SubResource("GDScript_d8v8v")
|
|
|
|
|
2025-05-05 00:11:49 +02:00
|
|
|
[node name="ColorRect" type="ColorRect" parent="."]
|
|
|
|
layout_mode = 1
|
|
|
|
anchors_preset = 15
|
|
|
|
anchor_right = 1.0
|
|
|
|
anchor_bottom = 1.0
|
|
|
|
grow_horizontal = 2
|
|
|
|
grow_vertical = 2
|
|
|
|
color = Color(1, 1, 0.666667, 0.0784314)
|
|
|
|
|
2025-04-23 15:37:03 +02:00
|
|
|
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
|
|
|
layout_mode = 1
|
2025-05-05 00:11:49 +02:00
|
|
|
anchors_preset = 8
|
|
|
|
anchor_left = 0.5
|
2025-04-23 15:37:03 +02:00
|
|
|
anchor_top = 0.5
|
2025-05-05 00:11:49 +02:00
|
|
|
anchor_right = 0.5
|
2025-04-23 15:37:03 +02:00
|
|
|
anchor_bottom = 0.5
|
2025-05-05 00:11:49 +02:00
|
|
|
offset_left = -171.5
|
|
|
|
offset_top = -155.0
|
|
|
|
offset_right = 171.5
|
|
|
|
offset_bottom = 155.0
|
2025-04-23 15:37:03 +02:00
|
|
|
grow_horizontal = 2
|
|
|
|
grow_vertical = 2
|
|
|
|
theme_override_constants/separation = 10
|
2025-05-05 00:11:49 +02:00
|
|
|
alignment = 1
|
|
|
|
|
|
|
|
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer"]
|
|
|
|
layout_mode = 2
|
|
|
|
theme_override_constants/margin_bottom = 40
|
|
|
|
|
|
|
|
[node name="Notice" type="Label" parent="VBoxContainer/MarginContainer"]
|
|
|
|
layout_mode = 2
|
|
|
|
theme_override_styles/normal = SubResource("StyleBoxFlat_s0u37")
|
|
|
|
text = "Paused!"
|
|
|
|
label_settings = SubResource("LabelSettings_s0u37")
|
|
|
|
horizontal_alignment = 1
|
|
|
|
vertical_alignment = 1
|
2025-04-23 15:37:03 +02:00
|
|
|
|
|
|
|
[node name="Btn_Resume" type="Button" parent="VBoxContainer"]
|
|
|
|
layout_mode = 2
|
|
|
|
size_flags_vertical = 6
|
2025-05-05 00:11:49 +02:00
|
|
|
mouse_default_cursor_shape = 2
|
|
|
|
text = "Resume the game!"
|
2025-04-23 15:37:03 +02:00
|
|
|
|
2025-05-05 00:11:49 +02:00
|
|
|
[node name="Btn_Settings" type="Button" parent="VBoxContainer"]
|
2025-04-23 15:37:03 +02:00
|
|
|
layout_mode = 2
|
2025-05-05 00:11:49 +02:00
|
|
|
mouse_default_cursor_shape = 2
|
|
|
|
text = "Show the settings menu!"
|
2025-04-23 15:37:03 +02:00
|
|
|
|
|
|
|
[node name="Btn_Restart" type="Button" parent="VBoxContainer"]
|
|
|
|
layout_mode = 2
|
|
|
|
size_flags_vertical = 6
|
2025-05-05 00:11:49 +02:00
|
|
|
mouse_default_cursor_shape = 2
|
|
|
|
text = "Restart the level!"
|
2025-04-23 15:37:03 +02:00
|
|
|
|
|
|
|
[node name="Btn_Quit" type="Button" parent="VBoxContainer"]
|
|
|
|
layout_mode = 2
|
|
|
|
size_flags_vertical = 6
|
2025-05-05 00:11:49 +02:00
|
|
|
mouse_default_cursor_shape = 2
|
|
|
|
text = "Quit to the main menu!"
|
|
|
|
|
|
|
|
[node name="SettingsContainer" type="ColorRect" parent="."]
|
|
|
|
visible = false
|
|
|
|
layout_mode = 1
|
|
|
|
anchors_preset = 15
|
|
|
|
anchor_right = 1.0
|
|
|
|
anchor_bottom = 1.0
|
|
|
|
grow_horizontal = 2
|
|
|
|
grow_vertical = 2
|
|
|
|
color = Color(0.20871, 0.20871, 0.20871, 0.784314)
|
2025-04-23 15:37:03 +02:00
|
|
|
|
|
|
|
[connection signal="pressed" from="VBoxContainer/Btn_Resume" to="." method="_on_btn_resume_pressed"]
|
2025-05-05 00:11:49 +02:00
|
|
|
[connection signal="pressed" from="VBoxContainer/Btn_Settings" to="." method="_on_btn_settings_pressed"]
|
2025-04-23 15:37:03 +02:00
|
|
|
[connection signal="pressed" from="VBoxContainer/Btn_Restart" to="." method="_on_btn_restart_pressed"]
|
|
|
|
[connection signal="pressed" from="VBoxContainer/Btn_Quit" to="." method="_on_btn_quit_pressed"]
|