diff options
| author | Radio <radiohotline@disroot.org> | 2026-05-30 00:15:31 +0300 |
|---|---|---|
| committer | Radio <radiohotline@disroot.org> | 2026-05-30 00:15:31 +0300 |
| commit | 9d87bc7922f76dc835ac4d4e99115b204cbfdea7 (patch) | |
| tree | c777566d4a5026ec9a166cbb37769afa588282fb /scenes | |
| parent | c10385a69170ac4e366477ded90cacb83b98d787 (diff) | |
menus my menu
Diffstat (limited to 'scenes')
| -rw-r--r-- | scenes/room/start.tscn | 9 | ||||
| -rw-r--r-- | scenes/ui/menu.gd | 20 | ||||
| -rw-r--r-- | scenes/ui/menu.gd.uid | 1 | ||||
| -rw-r--r-- | scenes/ui/menu.tscn | 63 | ||||
| -rw-r--r-- | scenes/ui/options.gd | 4 | ||||
| -rw-r--r-- | scenes/ui/options.gd.uid | 1 | ||||
| -rw-r--r-- | scenes/ui/options.tscn | 53 | ||||
| -rw-r--r-- | scenes/ui/title.tscn | 70 | ||||
| -rw-r--r-- | scenes/ui/title_button.gd | 20 | ||||
| -rw-r--r-- | scenes/ui/title_button.gd.uid | 1 | ||||
| -rw-r--r-- | scenes/ui/title_button.tscn | 8 |
11 files changed, 250 insertions, 0 deletions
diff --git a/scenes/room/start.tscn b/scenes/room/start.tscn new file mode 100644 index 0000000..b7ad877 --- /dev/null +++ b/scenes/room/start.tscn @@ -0,0 +1,9 @@ +[gd_scene format=3 uid="uid://cec247tmm7ait"] + +[ext_resource type="Texture2D" uid="uid://cfn3ctcvyfjn0" path="res://room/start/room.jpg" id="1_ft2pm"] + +[node name="Start" type="Node2D" unique_id=2088608692] + +[node name="Room" type="Sprite2D" parent="." unique_id=1997957082] +texture = ExtResource("1_ft2pm") +centered = false diff --git a/scenes/ui/menu.gd b/scenes/ui/menu.gd new file mode 100644 index 0000000..16882a4 --- /dev/null +++ b/scenes/ui/menu.gd @@ -0,0 +1,20 @@ +extends CanvasLayer + +var menu: CanvasLayer + +func _input(event: InputEvent) -> void: + if event.is_action_pressed("ui_menu"): + if menu: + menu.queue_free() + menu = null + else: + menu = load("uid://dqhxjaxlgy4yf").instantiate() + add_child(menu) + + +func _on_main_menu_pressed() -> void: + get_tree().change_scene_to_file("res://scenes/ui/title.tscn") + + +func _on_quit_pressed() -> void: + get_tree().quit() diff --git a/scenes/ui/menu.gd.uid b/scenes/ui/menu.gd.uid new file mode 100644 index 0000000..45d6d4f --- /dev/null +++ b/scenes/ui/menu.gd.uid @@ -0,0 +1 @@ +uid://befvsvog6282s diff --git a/scenes/ui/menu.tscn b/scenes/ui/menu.tscn new file mode 100644 index 0000000..37d83d5 --- /dev/null +++ b/scenes/ui/menu.tscn @@ -0,0 +1,63 @@ +[gd_scene format=3 uid="uid://dqhxjaxlgy4yf"] + +[ext_resource type="Script" uid="uid://befvsvog6282s" path="res://scenes/ui/menu.gd" id="1_wedc3"] +[ext_resource type="PackedScene" uid="uid://dj2dk1g7jnk23" path="res://scenes/ui/title_button.tscn" id="2_c2n5p"] + +[node name="CanvasLayer" type="CanvasLayer" unique_id=1450802124] +script = ExtResource("1_wedc3") + +[node name="Menu" type="Control" parent="." unique_id=115089705] +layout_mode = 3 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 + +[node name="VBoxContainer" type="VBoxContainer" parent="Menu" unique_id=604076564] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -260.5 +offset_top = -294.0 +offset_right = 260.5 +offset_bottom = 294.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Label" type="Label" parent="Menu/VBoxContainer" unique_id=1102397096] +layout_mode = 2 +theme_override_font_sizes/font_size = 100 +text = "MENU!!!!!!!!" +horizontal_alignment = 1 +uppercase = true + +[node name="Save" parent="Menu/VBoxContainer" unique_id=1597537067 instance=ExtResource("2_c2n5p")] +layout_mode = 2 +text = "Save" + +[node name="Load" parent="Menu/VBoxContainer" unique_id=1726486889 instance=ExtResource("2_c2n5p")] +layout_mode = 2 +text = "Load" + +[node name="Options" parent="Menu/VBoxContainer" unique_id=674602521 instance=ExtResource("2_c2n5p")] +layout_mode = 2 +text = "Options" + +[node name="Main Menu" parent="Menu/VBoxContainer" unique_id=1904714546 instance=ExtResource("2_c2n5p")] +layout_mode = 2 +text = "Main Menu" + +[node name="Quit" parent="Menu/VBoxContainer" unique_id=1892162088 instance=ExtResource("2_c2n5p")] +layout_mode = 2 +text = "Quit" + +[connection signal="pressed" from="Menu/VBoxContainer/Main Menu" to="." method="_on_main_menu_pressed"] +[connection signal="pressed" from="Menu/VBoxContainer/Quit" to="." method="_on_quit_pressed"] diff --git a/scenes/ui/options.gd b/scenes/ui/options.gd new file mode 100644 index 0000000..fa4e56a --- /dev/null +++ b/scenes/ui/options.gd @@ -0,0 +1,4 @@ +extends CanvasLayer + +func _on_close_pressed() -> void: + diff --git a/scenes/ui/options.gd.uid b/scenes/ui/options.gd.uid new file mode 100644 index 0000000..f0c89ba --- /dev/null +++ b/scenes/ui/options.gd.uid @@ -0,0 +1 @@ +uid://ck4twnv274ivh diff --git a/scenes/ui/options.tscn b/scenes/ui/options.tscn new file mode 100644 index 0000000..252eccd --- /dev/null +++ b/scenes/ui/options.tscn @@ -0,0 +1,53 @@ +[gd_scene format=3 uid="uid://i8ml66ykc8eh"] + +[ext_resource type="PackedScene" uid="uid://dj2dk1g7jnk23" path="res://scenes/ui/title_button.tscn" id="1_ad3a0"] +[ext_resource type="Script" uid="uid://ck4twnv274ivh" path="res://scenes/ui/options.gd" id="1_lr2b1"] + +[node name="CanvasLayer" type="CanvasLayer" unique_id=1973935756] +script = ExtResource("1_lr2b1") + +[node name="Control" type="Control" parent="." unique_id=1010669591] +layout_mode = 3 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -20.0 +offset_top = -20.0 +offset_right = 20.0 +offset_bottom = 20.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="Control" unique_id=551513181] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -50.0 +offset_top = -92.5 +offset_right = 50.0 +offset_bottom = 92.5 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Label" type="Label" parent="Control/VBoxContainer" unique_id=1111325079] +layout_mode = 2 +theme_override_font_sizes/font_size = 50 +text = "OPTIONS" + +[node name="Button" parent="Control/VBoxContainer" unique_id=1597537067 instance=ExtResource("1_ad3a0")] +layout_mode = 2 + +[node name="Button2" parent="Control/VBoxContainer" unique_id=932377545 instance=ExtResource("1_ad3a0")] +layout_mode = 2 + +[node name="Close" parent="Control/VBoxContainer" unique_id=1306792286 instance=ExtResource("1_ad3a0")] +layout_mode = 2 +text = "Close +" + +[connection signal="pressed" from="Control/VBoxContainer/Close" to="." method="_on_close_pressed"] diff --git a/scenes/ui/title.tscn b/scenes/ui/title.tscn new file mode 100644 index 0000000..65b44fd --- /dev/null +++ b/scenes/ui/title.tscn @@ -0,0 +1,70 @@ +[gd_scene format=3 uid="uid://c2cmda8vfq0lb"] + +[ext_resource type="Script" uid="uid://c5pqgx27uuybk" path="res://scenes/ui/title_button.gd" id="1_g80e2"] +[ext_resource type="PackedScene" uid="uid://dj2dk1g7jnk23" path="res://scenes/ui/title_button.tscn" id="1_t6us6"] + +[node name="Control" type="Control" unique_id=930849088] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_g80e2") + +[node name="MarginContainer2" type="MarginContainer" parent="." unique_id=22126455] +layout_mode = 1 +anchors_preset = 5 +anchor_left = 0.5 +anchor_right = 0.5 +offset_left = -359.5 +offset_right = 359.5 +offset_bottom = 273.0 +grow_horizontal = 2 +theme_override_constants/margin_top = 50 + +[node name="Label" type="Label" parent="MarginContainer2" unique_id=1066740590] +layout_mode = 2 +size_flags_horizontal = 0 +theme_override_font_sizes/font_size = 200 +text = "MULCH" +uppercase = true + +[node name="MarginContainer" type="MarginContainer" parent="." unique_id=1839328694] +layout_mode = 1 +anchors_preset = 12 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = -219.0 +grow_horizontal = 2 +grow_vertical = 0 +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="Hbox" type="HBoxContainer" parent="MarginContainer" unique_id=728577623] +layout_mode = 2 +theme_override_constants/separation = 25 +alignment = 1 + +[node name="Start" parent="MarginContainer/Hbox" unique_id=1597537067 instance=ExtResource("1_t6us6")] +layout_mode = 2 +text = "Start" + +[node name="Load" parent="MarginContainer/Hbox" unique_id=1936574972 instance=ExtResource("1_t6us6")] +layout_mode = 2 +text = "Load" + +[node name="Options" parent="MarginContainer/Hbox" unique_id=1664031607 instance=ExtResource("1_t6us6")] +layout_mode = 2 +text = "Options" + +[node name="Quit" parent="MarginContainer/Hbox" unique_id=443491275 instance=ExtResource("1_t6us6")] +layout_mode = 2 +text = "Quit" + +[connection signal="pressed" from="MarginContainer/Hbox/Start" to="." method="_on_start_pressed"] +[connection signal="pressed" from="MarginContainer/Hbox/Options" to="." method="_on_options_pressed"] +[connection signal="pressed" from="MarginContainer/Hbox/Quit" to="." method="_on_exit_pressed"] diff --git a/scenes/ui/title_button.gd b/scenes/ui/title_button.gd new file mode 100644 index 0000000..3dc86fb --- /dev/null +++ b/scenes/ui/title_button.gd @@ -0,0 +1,20 @@ +extends Control + +var options: CanvasLayer + +func _on_exit_pressed() -> void: + get_tree().quit() + + +func _on_start_pressed() -> void: + get_tree().change_scene_to_file("res://scenes/room/start.tscn") + + +func _on_main_menu_pressed() -> void: + get_tree().change_scene_to_file("res://scenes/ui/title.tscn") + + +func _on_options_pressed() -> void: + options = load("uid://i8ml66ykc8eh").instantiate() + add_child(options) + diff --git a/scenes/ui/title_button.gd.uid b/scenes/ui/title_button.gd.uid new file mode 100644 index 0000000..e1ce955 --- /dev/null +++ b/scenes/ui/title_button.gd.uid @@ -0,0 +1 @@ +uid://c5pqgx27uuybk diff --git a/scenes/ui/title_button.tscn b/scenes/ui/title_button.tscn new file mode 100644 index 0000000..8c876d3 --- /dev/null +++ b/scenes/ui/title_button.tscn @@ -0,0 +1,8 @@ +[gd_scene format=3 uid="uid://dj2dk1g7jnk23"] + +[node name="Button" type="Button" unique_id=1597537067] +custom_minimum_size = Vector2(100, 50) +offset_right = 8.0 +offset_bottom = 8.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 |
