break-utopia/project/objects/ui/pause_menu.tscn

79 lines
2.2 KiB
Text

[gd_scene format=3 uid="uid://881tkl7idnnj"]
[ext_resource type="Theme" uid="uid://2c3n2t1yxwlu" path="res://menu_theme.tres" id="1_ljtns"]
[sub_resource type="GDScript" id="GDScript_08qk3"]
script/source = "extends Control
func set_paused(paused : bool):
get_tree().paused = paused
visible = paused
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE if visible else Input.MOUSE_MODE_CAPTURED
func _ready():
visible = false
func _unhandled_input(event: InputEvent) -> void:
if visible != get_tree().paused:
return
if event.is_action_pressed(\"menu\"):
set_paused(!get_tree().paused)
%Continue.grab_focus()
func _on_continue_pressed() -> void:
set_paused(false)
func _on_quit_pressed() -> void:
get_tree().paused = false
get_tree().change_scene_to_file.call_deferred(\"res://scenes/main_menu.tscn\")
"
[node name="PauseMenu" type="Control" unique_id=973328140]
process_mode = 3
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("1_ljtns")
script = SubResource("GDScript_08qk3")
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=2082924246]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -39.5
offset_top = -20.0
offset_right = 39.5
offset_bottom = 20.0
grow_horizontal = 2
grow_vertical = 2
[node name="RichTextLabel" type="RichTextLabel" parent="VBoxContainer" unique_id=1997982412]
layout_mode = 2
theme_override_font_sizes/italics_font_size = 32
bbcode_enabled = true
text = "[i]-= Paused =-[/i]"
fit_content = true
autowrap_mode = 0
[node name="Continue" type="Button" parent="VBoxContainer" unique_id=313196666]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
text = "Continue"
[node name="Quit" type="Button" parent="VBoxContainer" unique_id=361681499]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
text = "Main Menu"
[connection signal="pressed" from="VBoxContainer/Continue" to="." method="_on_continue_pressed"]
[connection signal="pressed" from="VBoxContainer/Quit" to="." method="_on_quit_pressed"]