diff options
author | metamuffin <metamuffin@disroot.org> | 2024-06-24 21:25:42 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-06-24 21:25:42 +0200 |
commit | 54c75911214b87664a85a2195b11cdabe11b8640 (patch) | |
tree | 346ac43c3012380b948fe423701b4ffc10bf8541 | |
parent | 92535c24358339638af71272f444ae843bc129c1 (diff) | |
download | hurrycurry-54c75911214b87664a85a2195b11cdabe11b8640.tar hurrycurry-54c75911214b87664a85a2195b11cdabe11b8640.tar.bz2 hurrycurry-54c75911214b87664a85a2195b11cdabe11b8640.tar.zst |
add settings menu
-rw-r--r-- | client/menu/ingame_menu.tscn | 2 | ||||
-rw-r--r-- | client/menu/main_menu.gd | 10 | ||||
-rw-r--r-- | client/menu/main_menu.tscn | 2 | ||||
-rw-r--r-- | client/menu/settings_menu.gd | 19 | ||||
-rw-r--r-- | client/menu/settings_menu.tscn | 65 |
5 files changed, 92 insertions, 6 deletions
diff --git a/client/menu/ingame_menu.tscn b/client/menu/ingame_menu.tscn index da0767ff..44471db2 100644 --- a/client/menu/ingame_menu.tscn +++ b/client/menu/ingame_menu.tscn @@ -72,7 +72,7 @@ anchors_preset = 9 anchor_bottom = 1.0 offset_left = -400.0 offset_right = -90.0 -offset_bottom = 3888.0 +offset_bottom = 4536.0 grow_vertical = 2 [node name="margin" type="MarginContainer" parent="side"] diff --git a/client/menu/main_menu.gd b/client/menu/main_menu.gd index b19d72a6..99fe1858 100644 --- a/client/menu/main_menu.gd +++ b/client/menu/main_menu.gd @@ -1,19 +1,19 @@ # Undercooked - a game about cooking # Copyright 2024 metamuffin # Copyright 2024 tpart -# +# # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, version 3 of the License only. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. -# +# # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -# +# extends Control @onready var quick_connect = $side/margin/options/quick_connect @@ -51,3 +51,5 @@ func connect_to(url): func _on_change_character_pressed(): $SceneTransition.transition_to("res://menu/character_menu.tscn") +func _on_settings_pressed(): + $SceneTransition.transition_to("res://menu/settings_menu.tscn") diff --git a/client/menu/main_menu.tscn b/client/menu/main_menu.tscn index d7922ee6..32a5bb24 100644 --- a/client/menu/main_menu.tscn +++ b/client/menu/main_menu.tscn @@ -105,6 +105,6 @@ layout_mode = 1 [connection signal="pressed" from="side/margin/options/quick_connect" to="." method="_on_quick_connect_pressed"] [connection signal="pressed" from="side/margin/options/connect/connect" to="." method="_on_connect_pressed"] [connection signal="pressed" from="side/margin/options/change_character" to="." method="_on_change_character_pressed"] -[connection signal="pressed" from="side/margin/options/settings" to="." method="_on_credits_pressed"] +[connection signal="pressed" from="side/margin/options/settings" to="." method="_on_settings_pressed"] [connection signal="pressed" from="side/margin/options/credits" to="." method="_on_credits_pressed"] [connection signal="pressed" from="side/margin/options/quit" to="." method="_on_quit_pressed"] diff --git a/client/menu/settings_menu.gd b/client/menu/settings_menu.gd new file mode 100644 index 00000000..a023cf36 --- /dev/null +++ b/client/menu/settings_menu.gd @@ -0,0 +1,19 @@ +# Undercooked - a game about cooking +# Copyright 2024 metamuffin +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, version 3 of the License only. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. +# +extends Control + +func _on_back_pressed(): + $SceneTransition.transition_to("res://menu/main_menu.tscn") diff --git a/client/menu/settings_menu.tscn b/client/menu/settings_menu.tscn new file mode 100644 index 00000000..18a32759 --- /dev/null +++ b/client/menu/settings_menu.tscn @@ -0,0 +1,65 @@ +[gd_scene load_steps=5 format=3 uid="uid://8ic77jmadadj"] + +[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme.tres" id="1_foq3a"] +[ext_resource type="PackedScene" uid="uid://l4vm07dtda4j" path="res://menu/menu_background.tscn" id="1_wi8ti"] +[ext_resource type="Script" path="res://menu/settings_menu.gd" id="2_3hgm8"] +[ext_resource type="PackedScene" uid="uid://bg2d78ycorcqk" path="res://menu/scene_transition.tscn" id="2_t0one"] + +[node name="SettingsMenu" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1_foq3a") +script = ExtResource("2_3hgm8") + +[node name="MenuBackground" parent="." instance=ExtResource("1_wi8ti")] + +[node name="outer_gap" type="MarginContainer" parent="."] +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 = 40 +theme_override_constants/margin_top = 40 +theme_override_constants/margin_right = 40 +theme_override_constants/margin_bottom = 40 + +[node name="panel" type="Panel" parent="outer_gap"] +layout_mode = 2 + +[node name="inner_gap" type="MarginContainer" parent="outer_gap/panel"] +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 = 40 +theme_override_constants/margin_top = 40 +theme_override_constants/margin_right = 40 +theme_override_constants/margin_bottom = 40 + +[node name="options" type="VBoxContainer" parent="outer_gap/panel/inner_gap"] +layout_mode = 2 + +[node name="title" type="Label" parent="outer_gap/panel/inner_gap/options"] +layout_mode = 2 +size_flags_horizontal = 0 +theme_override_font_sizes/font_size = 36 +text = "Settings" + +[node name="back" type="Button" parent="outer_gap/panel/inner_gap"] +layout_mode = 2 +size_flags_vertical = 8 +text = "Back to Main Menu" + +[node name="SceneTransition" parent="." instance=ExtResource("2_t0one")] +visible = false +layout_mode = 1 + +[connection signal="pressed" from="outer_gap/panel/inner_gap/back" to="." method="_on_back_pressed"] |