diff options
author | metamuffin <metamuffin@disroot.org> | 2024-06-25 23:34:24 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-06-25 23:34:24 +0200 |
commit | ab6279e726ac7e10a4c5211a3d3827471fd35ccf (patch) | |
tree | 7b340790b07a7873af49ce99ccfde7beb03e838c /client/menu | |
parent | 4dc15a1e86ef1ae985fdf36f1a84d07b1de99ea7 (diff) | |
parent | b24e3fbd14a238dbdd880b4eda1709b7c60aabc9 (diff) | |
download | hurrycurry-ab6279e726ac7e10a4c5211a3d3827471fd35ccf.tar hurrycurry-ab6279e726ac7e10a4c5211a3d3827471fd35ccf.tar.bz2 hurrycurry-ab6279e726ac7e10a4c5211a3d3827471fd35ccf.tar.zst |
Merge branch 'master' of codeberg.org:metamuffin/undercooked
Diffstat (limited to 'client/menu')
-rw-r--r-- | client/menu/arrow.svg | 1 | ||||
-rw-r--r-- | client/menu/arrow.svg.import | 37 | ||||
-rw-r--r-- | client/menu/back.svg.import | 37 | ||||
-rw-r--r-- | client/menu/character_menu.gd | 15 | ||||
-rw-r--r-- | client/menu/character_menu.tscn | 81 | ||||
-rw-r--r-- | client/menu/credits_menu.gd | 20 | ||||
-rw-r--r-- | client/menu/credits_menu.tscn | 55 |
7 files changed, 188 insertions, 58 deletions
diff --git a/client/menu/arrow.svg b/client/menu/arrow.svg new file mode 100644 index 00000000..bafc9e69 --- /dev/null +++ b/client/menu/arrow.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 70 100"><path stroke="white" stroke-width="10" fill="none" d="M20,20 L50,50 L 20,80" /></svg>
\ No newline at end of file diff --git a/client/menu/arrow.svg.import b/client/menu/arrow.svg.import new file mode 100644 index 00000000..198224ad --- /dev/null +++ b/client/menu/arrow.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://35rd5gamtyqm" +path="res://.godot/imported/arrow.svg-41f5cc1ac36d42c934f574d48bb6dcd0.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://menu/arrow.svg" +dest_files=["res://.godot/imported/arrow.svg-41f5cc1ac36d42c934f574d48bb6dcd0.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/client/menu/back.svg.import b/client/menu/back.svg.import new file mode 100644 index 00000000..c1d3f246 --- /dev/null +++ b/client/menu/back.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bho8snt36o47u" +path="res://.godot/imported/back.svg-3e820259a1f002a01cdabc54e94ce8f4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://menu/back.svg" +dest_files=["res://.godot/imported/back.svg-3e820259a1f002a01cdabc54e94ce8f4.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/client/menu/character_menu.gd b/client/menu/character_menu.gd index 836dc7c3..e63243e1 100644 --- a/client/menu/character_menu.gd +++ b/client/menu/character_menu.gd @@ -15,8 +15,13 @@ # extends Control +@onready var character: Character = $Character +@onready var num_hairstyles := character.hairstyles.keys().size() + +var hairstyle := 0 + func _ready(): - $top_panel/a/username.text = Global.username + $VBoxContainer/top_panel/a/username.text = Global.username func _notification(what): if what == NOTIFICATION_PREDELETE: @@ -27,3 +32,11 @@ func _on_back_pressed(): func _on_username_text_changed(new_text): Global.username = new_text + +func _on_character_back_pressed(): + hairstyle = (hairstyle - 1) % num_hairstyles + character.select_hairstyle(hairstyle) + +func _on_character_forward_pressed(): + hairstyle = (hairstyle + 1) % num_hairstyles + character.select_hairstyle(hairstyle) diff --git a/client/menu/character_menu.tscn b/client/menu/character_menu.tscn index 8c4d0d96..29c9c88f 100644 --- a/client/menu/character_menu.tscn +++ b/client/menu/character_menu.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=6 format=3 uid="uid://1f7xpirm5d28"] +[gd_scene load_steps=7 format=3 uid="uid://1f7xpirm5d28"] [ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme.tres" id="1_ak2pw"] [ext_resource type="Script" path="res://menu/character_menu.gd" id="1_brhd1"] [ext_resource type="PackedScene" uid="uid://b3hhir2fvnunu" path="res://player/character/character.tscn" id="3_odq7n"] [ext_resource type="PackedScene" uid="uid://bg2d78ycorcqk" path="res://menu/scene_transition.tscn" id="4_c0ocf"] +[ext_resource type="Texture2D" uid="uid://35rd5gamtyqm" path="res://menu/arrow.svg" id="5_kvd7k"] [sub_resource type="Environment" id="Environment_ex25y"] background_mode = 1 @@ -28,16 +29,25 @@ transform = Transform3D(0.857401, 0, 0.514649, -0.15367, 0.954381, 0.256012, -0. [node name="Camera3D" type="Camera3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.75, 1.75) -[node name="guy" parent="." instance=ExtResource("3_odq7n")] +[node name="Character" parent="." instance=ExtResource("3_odq7n")] -[node name="top_panel" type="Panel" parent="."] +[node name="SceneTransition" parent="." instance=ExtResource("4_c0ocf")] +visible = false +layout_mode = 1 + +[node name="VBoxContainer" type="VBoxContainer" parent="."] layout_mode = 1 -anchors_preset = 10 +anchors_preset = 15 anchor_right = 1.0 -offset_bottom = 113.0 +anchor_bottom = 1.0 grow_horizontal = 2 +grow_vertical = 2 -[node name="a" type="VBoxContainer" parent="top_panel"] +[node name="top_panel" type="Panel" parent="VBoxContainer"] +custom_minimum_size = Vector2(0, 100) +layout_mode = 2 + +[node name="a" type="VBoxContainer" parent="VBoxContainer/top_panel"] layout_mode = 1 anchors_preset = 5 anchor_left = 0.5 @@ -48,25 +58,48 @@ offset_right = 216.0 offset_bottom = 110.0 grow_horizontal = 2 -[node name="Label" type="Label" parent="top_panel/a"] +[node name="Label" type="Label" parent="VBoxContainer/top_panel/a"] layout_mode = 2 -text = "This Chef is called" +text = "Username" horizontal_alignment = 1 -[node name="username" type="LineEdit" parent="top_panel/a"] +[node name="username" type="LineEdit" parent="VBoxContainer/top_panel/a"] layout_mode = 2 -[node name="bottom_panel" type="Panel" parent="."] -layout_mode = 1 -anchors_preset = 12 -anchor_top = 1.0 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_top = -61.0 -grow_horizontal = 2 -grow_vertical = 0 +[node name="Spacer" type="MarginContainer" parent="VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 +theme_override_constants/margin_left = 50 +theme_override_constants/margin_top = 50 +theme_override_constants/margin_right = 50 +theme_override_constants/margin_bottom = 50 + +[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/Spacer"] +layout_mode = 2 +alignment = 1 + +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/Spacer/VBoxContainer"] +layout_mode = 2 +alignment = 1 + +[node name="Back" type="TextureButton" parent="VBoxContainer/Spacer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +texture_normal = ExtResource("5_kvd7k") +flip_h = true + +[node name="Spacer" type="Control" parent="VBoxContainer/Spacer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 -[node name="back" type="Button" parent="bottom_panel"] +[node name="Forward" type="TextureButton" parent="VBoxContainer/Spacer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +texture_normal = ExtResource("5_kvd7k") + +[node name="bottom_panel" type="Panel" parent="VBoxContainer"] +custom_minimum_size = Vector2(0, 75) +layout_mode = 2 + +[node name="back" type="Button" parent="VBoxContainer/bottom_panel"] layout_mode = 1 anchors_preset = 8 anchor_left = 0.5 @@ -82,9 +115,7 @@ grow_vertical = 2 size_flags_vertical = 8 text = "Back" -[node name="SceneTransition" parent="." instance=ExtResource("4_c0ocf")] -visible = false -layout_mode = 1 - -[connection signal="text_changed" from="top_panel/a/username" to="." method="_on_username_text_changed"] -[connection signal="pressed" from="bottom_panel/back" to="." method="_on_back_pressed"] +[connection signal="text_changed" from="VBoxContainer/top_panel/a/username" to="." method="_on_username_text_changed"] +[connection signal="pressed" from="VBoxContainer/Spacer/VBoxContainer/HBoxContainer/Back" to="." method="_on_character_back_pressed"] +[connection signal="pressed" from="VBoxContainer/Spacer/VBoxContainer/HBoxContainer/Forward" to="." method="_on_character_forward_pressed"] +[connection signal="pressed" from="VBoxContainer/bottom_panel/back" to="." method="_on_back_pressed"] diff --git a/client/menu/credits_menu.gd b/client/menu/credits_menu.gd index 3949b5c0..e3ea4c51 100644 --- a/client/menu/credits_menu.gd +++ b/client/menu/credits_menu.gd @@ -15,5 +15,25 @@ # extends Control +var contributors := ["sofviic", "metamuffin", "nokoe", "tpart"] +var cc_0 := ["kenney.nl", "Kay Lousberg"] +var cc_by_3 := { + "Glasses": "Jeremy Edelblut" +} + +@onready var label = $Panel/MarginContainer/VBoxContainer/RichTextLabel + +func _ready(): + contributors.shuffle() + label.text = "[center][b]undercooked - a game about cooking[/b]\n\ndeveloped by\n\n[b]" + label.text += ", ".join(contributors) + label.text += "[/b]\n\n" + + for k in cc_by_3.keys(): + var v = cc_by_3[k] + label.text += "[b]\"%s\" %s[/b]\nLicensed under Creative Commons: By Attribution 3.0 License\nhttps://creativecommons.org/licenses/by/3.0/\n\n" % [k, v] + + label.text += "[b]Additional CC0 assets by:[/b]\n" + "\n".join(cc_0) + func _on_back_pressed(): $SceneTransition.transition_to("res://menu/main_menu.tscn") diff --git a/client/menu/credits_menu.tscn b/client/menu/credits_menu.tscn index 8c2fa5ed..a6536e16 100644 --- a/client/menu/credits_menu.tscn +++ b/client/menu/credits_menu.tscn @@ -6,7 +6,7 @@ [ext_resource type="PackedScene" uid="uid://bg2d78ycorcqk" path="res://menu/scene_transition.tscn" id="4_fbbdb"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_p2qmw"] -bg_color = Color(0, 0, 0, 0.576471) +bg_color = Color(0, 0, 0, 0.878431) [node name="CreditsMenu" type="Control"] layout_mode = 3 @@ -29,46 +29,37 @@ grow_horizontal = 2 grow_vertical = 2 theme_override_styles/panel = SubResource("StyleBoxFlat_p2qmw") -[node name="RichTextLabel" type="RichTextLabel" parent="Panel"] +[node name="MarginContainer" type="MarginContainer" parent="Panel"] layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -222.0 -offset_top = -112.0 -offset_right = 222.0 -offset_bottom = 125.0 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -bbcode_enabled = true -text = "[center][b]undercooked - a game about cooking[/b] - -by +theme_override_constants/margin_left = 50 +theme_override_constants/margin_top = 50 +theme_override_constants/margin_right = 50 +theme_override_constants/margin_bottom = 50 -[b]tpart, nokoe, metamuffin[/b] +[node name="VBoxContainer" type="VBoxContainer" parent="Panel/MarginContainer"] +layout_mode = 2 -using various models from kenney.nl -[/center]" +[node name="RichTextLabel" type="RichTextLabel" parent="Panel/MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 +theme_override_font_sizes/normal_font_size = 22 +theme_override_font_sizes/bold_font_size = 22 +theme_override_font_sizes/italics_font_size = 22 +theme_override_font_sizes/bold_italics_font_size = 22 +theme_override_font_sizes/mono_font_size = 22 +bbcode_enabled = true -[node name="back" type="Button" parent="Panel"] -layout_mode = 1 -anchors_preset = 7 -anchor_left = 0.5 -anchor_top = 1.0 -anchor_right = 0.5 -anchor_bottom = 1.0 -offset_left = -79.0 -offset_top = -65.0 -offset_right = 81.0 -offset_bottom = -34.0 -grow_horizontal = 2 -grow_vertical = 0 +[node name="back" type="Button" parent="Panel/MarginContainer/VBoxContainer"] +layout_mode = 2 text = "Back" [node name="SceneTransition" parent="." instance=ExtResource("4_fbbdb")] visible = false layout_mode = 1 -[connection signal="pressed" from="Panel/back" to="." method="_on_back_pressed"] +[connection signal="pressed" from="Panel/MarginContainer/VBoxContainer/back" to="." method="_on_back_pressed"] |