@ -0,0 +1,6 @@ | |||
## General Purpose signals | |||
extends Node | |||
signal options_menu_opened | |||
signal options_menu_closed |
@ -0,0 +1 @@ | |||
uid://biwce2o15q44g |
@ -0,0 +1,6 @@ | |||
[gd_resource type="Theme" format=3 uid="uid://b5q8b0l6qp1dt"] | |||
[resource] | |||
Button/colors/font_color = Color(0.839216, 0.933333, 1, 1) | |||
Button/constants/outline_size = 2 | |||
Button/font_sizes/font_size = 20 |
@ -1,89 +0,0 @@ | |||
[gd_scene format=3 uid="uid://w6wtjosjn1qu"] | |||
[node name="OptionsMenu" type="MarginContainer"] | |||
anchors_preset = 15 | |||
anchor_right = 1.0 | |||
anchor_bottom = 1.0 | |||
grow_horizontal = 2 | |||
grow_vertical = 2 | |||
[node name="PanelContainer" type="PanelContainer" parent="."] | |||
layout_mode = 2 | |||
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer"] | |||
layout_mode = 2 | |||
theme_override_constants/margin_left = 20 | |||
theme_override_constants/margin_top = 20 | |||
theme_override_constants/margin_right = 20 | |||
theme_override_constants/margin_bottom = 20 | |||
[node name="LeftContainer" type="HBoxContainer" parent="PanelContainer/MarginContainer"] | |||
layout_mode = 2 | |||
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/MarginContainer/LeftContainer"] | |||
layout_mode = 2 | |||
size_flags_horizontal = 3 | |||
[node name="Label" type="Label" parent="PanelContainer/MarginContainer/LeftContainer/VBoxContainer"] | |||
layout_mode = 2 | |||
size_flags_vertical = 0 | |||
theme_type_variation = &"HeaderLarge" | |||
text = "Options Menu" | |||
horizontal_alignment = 1 | |||
[node name="BlockHighlights" type="HBoxContainer" parent="PanelContainer/MarginContainer/LeftContainer/VBoxContainer"] | |||
layout_mode = 2 | |||
[node name="CheckButton" type="CheckButton" parent="PanelContainer/MarginContainer/LeftContainer/VBoxContainer/BlockHighlights"] | |||
layout_mode = 2 | |||
button_pressed = true | |||
text = "Enable Block Highlighting" | |||
[node name="Waila" type="HBoxContainer" parent="PanelContainer/MarginContainer/LeftContainer/VBoxContainer"] | |||
layout_mode = 2 | |||
[node name="CheckButton" type="CheckButton" parent="PanelContainer/MarginContainer/LeftContainer/VBoxContainer/Waila"] | |||
layout_mode = 2 | |||
button_pressed = true | |||
text = "Enable Waila" | |||
[node name="BottomRightContainer" type="HBoxContainer" parent="PanelContainer/MarginContainer"] | |||
layout_mode = 2 | |||
size_flags_horizontal = 8 | |||
size_flags_vertical = 8 | |||
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/MarginContainer/BottomRightContainer"] | |||
layout_mode = 2 | |||
size_flags_horizontal = 8 | |||
[node name="ControlsLabel" type="Label" parent="PanelContainer/MarginContainer/BottomRightContainer/VBoxContainer"] | |||
layout_mode = 2 | |||
theme_type_variation = &"HeaderSmall" | |||
text = "Controls" | |||
horizontal_alignment = 1 | |||
[node name="Controls" type="Label" parent="PanelContainer/MarginContainer/BottomRightContainer/VBoxContainer"] | |||
layout_mode = 2 | |||
text = "Left Click - Create Block | |||
Right Click - Delete Block | |||
Scoll Wheel - Change Block | |||
Ctrl - Crouch | |||
Shift - Sprint (until stop or toggled)" | |||
[node name="CenterContainer" type="CenterContainer" parent="PanelContainer/MarginContainer"] | |||
layout_mode = 2 | |||
size_flags_vertical = 8 | |||
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/MarginContainer/CenterContainer"] | |||
layout_mode = 2 | |||
theme_override_constants/separation = 10 | |||
[node name="CloseButton" type="Button" parent="PanelContainer/MarginContainer/CenterContainer/HBoxContainer"] | |||
layout_mode = 2 | |||
theme_override_font_sizes/font_size = 20 | |||
text = "Close Menu" | |||
[node name="ExitButton" type="Button" parent="PanelContainer/MarginContainer/CenterContainer/HBoxContainer"] | |||
layout_mode = 2 | |||
theme_override_font_sizes/font_size = 20 | |||
text = "Exit Game" |
@ -0,0 +1,37 @@ | |||
class_name PauseMenu | |||
extends Panel | |||
func _unhandled_input(event: InputEvent) -> void: | |||
if event.is_action_pressed("ui_cancel") and self.visible: | |||
hide_menu() | |||
elif event.is_action_pressed("ui_cancel") and !self.visible: | |||
show_menu() | |||
func show_menu() -> void: | |||
self.visible = true | |||
SignalManager.options_menu_opened.emit() | |||
func hide_menu() -> void: | |||
self.visible = false | |||
SignalManager.options_menu_closed.emit() | |||
# Signals | |||
func _on_exit_game_button_pressed() -> void: | |||
get_tree().quit() | |||
func _on_resume_button_pressed() -> void: | |||
hide_menu() | |||
func _on_quick_load_pressed() -> void: | |||
SaveGameManager.load_game() | |||
hide_menu() | |||
func _on_quick_save_pressed() -> void: | |||
SaveGameManager.save_game() | |||
hide_menu() | |||
func _on_settings_button_pressed() -> void: | |||
pass # Replace with function body. |
@ -0,0 +1 @@ | |||
uid://d3ysjgxxmyqpw |
@ -0,0 +1,81 @@ | |||
[gd_scene load_steps=3 format=3 uid="uid://bopvfwcgnnawg"] | |||
[ext_resource type="Theme" uid="uid://b5q8b0l6qp1dt" path="res://resources/pause_menu_theme.tres" id="1_6tw0m"] | |||
[ext_resource type="Script" uid="uid://d3ysjgxxmyqpw" path="res://scenes/ui/pause_menu.gd" id="2_0lmf7"] | |||
[node name="PauseMenu" type="Panel"] | |||
process_mode = 3 | |||
anchors_preset = 15 | |||
anchor_right = 1.0 | |||
anchor_bottom = 1.0 | |||
grow_horizontal = 2 | |||
grow_vertical = 2 | |||
theme = ExtResource("1_6tw0m") | |||
script = ExtResource("2_0lmf7") | |||
[node name="Background" type="ColorRect" parent="."] | |||
custom_minimum_size = Vector2(400, 0) | |||
layout_mode = 1 | |||
anchors_preset = 13 | |||
anchor_left = 0.5 | |||
anchor_right = 0.5 | |||
anchor_bottom = 1.0 | |||
grow_horizontal = 2 | |||
grow_vertical = 2 | |||
color = Color(0.192157, 0.239216, 0.352941, 1) | |||
[node name="MarginContainer" type="MarginContainer" parent="Background"] | |||
layout_mode = 1 | |||
anchors_preset = 15 | |||
anchor_right = 1.0 | |||
anchor_bottom = 1.0 | |||
grow_horizontal = 2 | |||
grow_vertical = 2 | |||
theme_override_constants/margin_left = 10 | |||
theme_override_constants/margin_top = 10 | |||
theme_override_constants/margin_right = 10 | |||
theme_override_constants/margin_bottom = 10 | |||
[node name="CenterContainer" type="VBoxContainer" parent="Background/MarginContainer"] | |||
layout_mode = 2 | |||
size_flags_horizontal = 4 | |||
theme_override_constants/separation = 20 | |||
[node name="Title" type="Label" parent="Background/MarginContainer/CenterContainer"] | |||
layout_mode = 2 | |||
theme_override_font_sizes/font_size = 40 | |||
text = "Paused" | |||
horizontal_alignment = 1 | |||
vertical_alignment = 1 | |||
[node name="ButtonsContainer" type="VBoxContainer" parent="Background/MarginContainer/CenterContainer"] | |||
layout_mode = 2 | |||
size_flags_vertical = 6 | |||
theme_override_constants/separation = 20 | |||
[node name="ResumeButton" type="Button" parent="Background/MarginContainer/CenterContainer/ButtonsContainer"] | |||
layout_mode = 2 | |||
text = "Resume" | |||
[node name="QuickSave" type="Button" parent="Background/MarginContainer/CenterContainer/ButtonsContainer"] | |||
layout_mode = 2 | |||
text = "Quick Save" | |||
[node name="QuickLoad" type="Button" parent="Background/MarginContainer/CenterContainer/ButtonsContainer"] | |||
layout_mode = 2 | |||
text = "Quick Load" | |||
[node name="SettingsButton" type="Button" parent="Background/MarginContainer/CenterContainer/ButtonsContainer"] | |||
layout_mode = 2 | |||
disabled = true | |||
text = "Settings" | |||
[node name="ExitGameButton" type="Button" parent="Background/MarginContainer/CenterContainer/ButtonsContainer"] | |||
layout_mode = 2 | |||
text = "Exit Game" | |||
[connection signal="pressed" from="Background/MarginContainer/CenterContainer/ButtonsContainer/ResumeButton" to="." method="_on_resume_button_pressed"] | |||
[connection signal="pressed" from="Background/MarginContainer/CenterContainer/ButtonsContainer/QuickSave" to="." method="_on_quick_save_pressed"] | |||
[connection signal="pressed" from="Background/MarginContainer/CenterContainer/ButtonsContainer/QuickLoad" to="." method="_on_quick_load_pressed"] | |||
[connection signal="pressed" from="Background/MarginContainer/CenterContainer/ButtonsContainer/SettingsButton" to="." method="_on_settings_button_pressed"] | |||
[connection signal="pressed" from="Background/MarginContainer/CenterContainer/ButtonsContainer/ExitGameButton" to="." method="_on_exit_game_button_pressed"] |