aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortpart <tpart120@proton.me>2024-07-17 21:44:51 +0200
committertpart <tpart120@proton.me>2024-07-17 21:45:28 +0200
commit315864c63650c7b5d7dbb6efb53dea47c4610881 (patch)
tree85850d5e74ee165257f724817fe83fce0a8359ad
parent547c7ce18391d69677b495ede8f73c5277ac017c (diff)
downloadhurrycurry-315864c63650c7b5d7dbb6efb53dea47c4610881.tar
hurrycurry-315864c63650c7b5d7dbb6efb53dea47c4610881.tar.bz2
hurrycurry-315864c63650c7b5d7dbb6efb53dea47c4610881.tar.zst
Add custom warning popup for setup menu and potential future use
-rw-r--r--client/menu/setup.gd5
-rw-r--r--client/menu/setup.tscn7
-rw-r--r--client/menu/warning_popup.gd5
-rw-r--r--client/menu/warning_popup.tscn50
4 files changed, 59 insertions, 8 deletions
diff --git a/client/menu/setup.gd b/client/menu/setup.gd
index 7a56a14d..9ed6bb64 100644
--- a/client/menu/setup.gd
+++ b/client/menu/setup.gd
@@ -51,8 +51,9 @@ func _process(delta):
scroll.set_deferred("scroll_vertical", scroll.scroll_vertical + s * delta * SCROLL_SPEED)
func _on_sign_pressed():
- if username.text == "": OS.alert("Name field cannot be empty."); return
- if character == -1: OS.alert("Hairstyle needs to be selected."); return
+ if username.text == "" or character == -1:
+ await submenu("res://menu/warning_popup.tscn")
+ return
sign_button.disabled = true
diff --git a/client/menu/setup.tscn b/client/menu/setup.tscn
index 5ef6a260..410cd582 100644
--- a/client/menu/setup.tscn
+++ b/client/menu/setup.tscn
@@ -1,9 +1,8 @@
-[gd_scene load_steps=15 format=3 uid="uid://ddl3efikvqp66"]
+[gd_scene load_steps=14 format=3 uid="uid://ddl3efikvqp66"]
[ext_resource type="Script" path="res://menu/setup.gd" id="1_mo46n"]
[ext_resource type="Theme" uid="uid://ci2qajdoa1an1" path="res://menu/theme/paper.tres" id="1_yq0aa"]
[ext_resource type="FontFile" uid="uid://bo4vh5xkpvrh1" path="res://menu/theme/font-sansita-swashed.woff2" id="3_2vg4d"]
-[ext_resource type="PackedScene" uid="uid://bg2d78ycorcqk" path="res://menu/scene_transition.tscn" id="4_u444t"]
[ext_resource type="AudioStream" uid="uid://do7ii5hx71p0m" path="res://menu/sounds/page.ogg" id="5_xac6d"]
[ext_resource type="AudioStream" uid="uid://5b3noxjmasmu" path="res://menu/sounds/sign.ogg" id="6_wf0gh"]
@@ -341,10 +340,6 @@ text = "Click to sign"
[node name="Underline" type="HSeparator" parent="ScrollContainer/Control/TextureRect/PaperMargin/Contents/Signatures/EmployeeMargin/Sign"]
layout_mode = 2
-[node name="SceneTransition" parent="." instance=ExtResource("4_u444t")]
-visible = false
-layout_mode = 1
-
[node name="Page" type="AudioStreamPlayer" parent="."]
stream = ExtResource("5_xac6d")
volume_db = -16.0
diff --git a/client/menu/warning_popup.gd b/client/menu/warning_popup.gd
new file mode 100644
index 00000000..f418550b
--- /dev/null
+++ b/client/menu/warning_popup.gd
@@ -0,0 +1,5 @@
+extends Menu
+class_name WarningPopup
+
+func _on_accept_pressed():
+ exit()
diff --git a/client/menu/warning_popup.tscn b/client/menu/warning_popup.tscn
new file mode 100644
index 00000000..784011b3
--- /dev/null
+++ b/client/menu/warning_popup.tscn
@@ -0,0 +1,50 @@
+[gd_scene load_steps=4 format=3 uid="uid://0v2olkwpm150"]
+
+[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_yk5xc"]
+[ext_resource type="Script" path="res://menu/warning_popup.gd" id="2_2vobb"]
+[ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://menu/theme/dark_blur_material.tres" id="3_5wavk"]
+
+[node name="WarningPopup" 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_yk5xc")
+script = ExtResource("2_2vobb")
+support_anim = false
+
+[node name="CenterContainer" type="CenterContainer" parent="."]
+layout_mode = 1
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+grow_horizontal = 2
+grow_vertical = 2
+
+[node name="Panel" type="PanelContainer" parent="CenterContainer"]
+material = ExtResource("3_5wavk")
+layout_mode = 2
+
+[node name="MarginContainer" type="MarginContainer" parent="CenterContainer/Panel"]
+layout_mode = 2
+
+[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer/Panel/MarginContainer"]
+layout_mode = 2
+theme_override_constants/separation = 16
+
+[node name="Message" type="Label" parent="CenterContainer/Panel/MarginContainer/VBoxContainer"]
+layout_mode = 2
+text = "You must fill out all requested fields."
+
+[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/Panel/MarginContainer/VBoxContainer"]
+layout_mode = 2
+alignment = 1
+
+[node name="Accept" type="Button" parent="CenterContainer/Panel/MarginContainer/VBoxContainer/HBoxContainer"]
+layout_mode = 2
+theme_override_font_sizes/font_size = 16
+text = "Accept"
+
+[connection signal="pressed" from="CenterContainer/Panel/MarginContainer/VBoxContainer/HBoxContainer/Accept" to="." method="_on_accept_pressed"]