WIP checkpoint: Implementation: Login/Register UI wired to /api/auth
This commit is contained in:
+44
-64
@@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=2 format=3]
|
[gd_scene load_steps=2 format=3 uid="uid://main_menu_scene"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scripts/main_menu.gd" id="1_main"]
|
[ext_resource type="Script" path="res://scripts/main_menu.gd" id="1_main"]
|
||||||
|
|
||||||
@@ -29,91 +29,72 @@ text = "AGP Game"
|
|||||||
horizontal_alignment = 1
|
horizontal_alignment = 1
|
||||||
theme_override_font_sizes/font_size = 72
|
theme_override_font_sizes/font_size = 72
|
||||||
|
|
||||||
[node name="AuthTabContainer" type="TabContainer" parent="CenterContainer/VBoxContainer"]
|
[node name="AuthPanel" type="PanelContainer" parent="CenterContainer/VBoxContainer"]
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
size_flags_horizontal = 4
|
visible = false
|
||||||
tabs = "Login\0Register"
|
|
||||||
|
|
||||||
[node name="LoginPanel" type="VBoxContainer" parent="CenterContainer/VBoxContainer/AuthTabContainer"]
|
[node name="MarginContainer" type="MarginContainer" parent="CenterContainer/VBoxContainer/AuthPanel"]
|
||||||
|
layout_mode = 1
|
||||||
|
theme_override_constants/margin_left = 24
|
||||||
|
theme_override_constants/margin_top = 24
|
||||||
|
theme_override_constants/margin_right = 24
|
||||||
|
theme_override_constants/margin_bottom = 24
|
||||||
|
|
||||||
|
[node name="AuthVBox" type="VBoxContainer" parent="CenterContainer/VBoxContainer/AuthPanel/MarginContainer"]
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
theme_override_constants/separation = 8
|
theme_override_constants/separation = 8
|
||||||
size_flags_horizontal = 4
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
[node name="LoginUsernameLabel" type="Label" parent="CenterContainer/VBoxContainer/AuthTabContainer/LoginPanel"]
|
[node name="AuthModeLabel" type="Label" parent="CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox"]
|
||||||
layout_mode = 1
|
|
||||||
text = "Username"
|
|
||||||
|
|
||||||
[node name="LoginUsername" type="LineEdit" parent="CenterContainer/VBoxContainer/AuthTabContainer/LoginPanel"]
|
|
||||||
layout_mode = 1
|
|
||||||
size_flags_horizontal = 4
|
|
||||||
placeholder_text = "Username"
|
|
||||||
|
|
||||||
[node name="LoginPassword" type="LineEdit" parent="CenterContainer/VBoxContainer/AuthTabContainer/LoginPanel"]
|
|
||||||
layout_mode = 1
|
|
||||||
size_flags_horizontal = 4
|
|
||||||
placeholder_text = "Password"
|
|
||||||
secret = true
|
|
||||||
|
|
||||||
[node name="LoginButton" type="Button" parent="CenterContainer/VBoxContainer/AuthTabContainer/LoginPanel"]
|
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
text = "Login"
|
text = "Login"
|
||||||
size_flags_horizontal = 4
|
horizontal_alignment = 1
|
||||||
|
theme_override_font_sizes/font_size = 24
|
||||||
|
|
||||||
[node name="RegisterPanel" type="VBoxContainer" parent="CenterContainer/VBoxContainer/AuthTabContainer"]
|
[node name="UsernameEdit" type="LineEdit" parent="CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox"]
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
theme_override_constants/separation = 8
|
|
||||||
size_flags_horizontal = 4
|
|
||||||
|
|
||||||
[node name="RegUsernameLabel" type="Label" parent="CenterContainer/VBoxContainer/AuthTabContainer/RegisterPanel"]
|
|
||||||
layout_mode = 1
|
|
||||||
text = "Username"
|
|
||||||
|
|
||||||
[node name="RegUsername" type="LineEdit" parent="CenterContainer/VBoxContainer/AuthTabContainer/RegisterPanel"]
|
|
||||||
layout_mode = 1
|
|
||||||
size_flags_horizontal = 4
|
|
||||||
placeholder_text = "Username"
|
placeholder_text = "Username"
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
[node name="RegEmailLabel" type="Label" parent="CenterContainer/VBoxContainer/AuthTabContainer/RegisterPanel"]
|
[node name="PasswordEdit" type="LineEdit" parent="CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox"]
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
text = "Email"
|
|
||||||
|
|
||||||
[node name="RegEmail" type="LineEdit" parent="CenterContainer/VBoxContainer/AuthTabContainer/RegisterPanel"]
|
|
||||||
layout_mode = 1
|
|
||||||
size_flags_horizontal = 4
|
|
||||||
placeholder_text = "Email"
|
|
||||||
|
|
||||||
[node name="RegPassword" type="LineEdit" parent="CenterContainer/VBoxContainer/AuthTabContainer/RegisterPanel"]
|
|
||||||
layout_mode = 1
|
|
||||||
size_flags_horizontal = 4
|
|
||||||
placeholder_text = "Password"
|
placeholder_text = "Password"
|
||||||
secret = true
|
size_flags_horizontal = 3
|
||||||
|
echo_password = true
|
||||||
|
|
||||||
[node name="RegDobLabel" type="Label" parent="CenterContainer/VBoxContainer/AuthTabContainer/RegisterPanel"]
|
[node name="EmailEdit" type="LineEdit" parent="CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox"]
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
text = "Date of Birth (YYYY-MM-DD)"
|
visible = false
|
||||||
|
placeholder_text = "Email"
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
[node name="RegDob" type="LineEdit" parent="CenterContainer/VBoxContainer/AuthTabContainer/RegisterPanel"]
|
[node name="DOBEdit" type="LineEdit" parent="CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox"]
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
size_flags_horizontal = 4
|
visible = false
|
||||||
placeholder_text = "YYYY-MM-DD"
|
placeholder_text = "Date of Birth (YYYY-MM-DD)"
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
[node name="RegisterButton" type="Button" parent="CenterContainer/VBoxContainer/AuthTabContainer/RegisterPanel"]
|
[node name="ModeToggle" type="CheckButton" parent="CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox"]
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
text = "Register"
|
text = "Register"
|
||||||
size_flags_horizontal = 4
|
|
||||||
|
|
||||||
[node name="ErrorLabel" type="Label" parent="CenterContainer/VBoxContainer"]
|
[node name="AuthButton" type="Button" parent="CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox"]
|
||||||
|
layout_mode = 1
|
||||||
|
text = "Login"
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
|
[node name="AuthStatusLabel" type="Label" parent="CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox"]
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
size_flags_horizontal = 4
|
|
||||||
text = ""
|
text = ""
|
||||||
font_color = Color(1, 0, 0, 1)
|
horizontal_alignment = 1
|
||||||
|
autowrap_mode = 2
|
||||||
visible = false
|
visible = false
|
||||||
|
|
||||||
[node name="UserInfoLabel" type="Label" parent="CenterContainer/VBoxContainer"]
|
[node name="WelcomeLabel" type="Label" parent="CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox"]
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
size_flags_horizontal = 4
|
|
||||||
text = ""
|
|
||||||
visible = false
|
visible = false
|
||||||
|
text = ""
|
||||||
|
horizontal_alignment = 1
|
||||||
|
|
||||||
[node name="PlayButton" type="Button" parent="CenterContainer/VBoxContainer"]
|
[node name="PlayButton" type="Button" parent="CenterContainer/VBoxContainer"]
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
@@ -125,10 +106,9 @@ layout_mode = 1
|
|||||||
text = "Quit"
|
text = "Quit"
|
||||||
size_flags_horizontal = 4
|
size_flags_horizontal = 4
|
||||||
|
|
||||||
[connection signal="pressed" from="CenterContainer/VBoxContainer/AuthTabContainer/LoginPanel/LoginButton" to="CenterContainer/VBoxContainer/AuthTabContainer" method="_on_login_button_pressed"]
|
|
||||||
[connection signal="pressed" from="CenterContainer/VBoxContainer/AuthTabContainer/RegisterPanel/RegisterButton" to="CenterContainer/VBoxContainer/AuthTabContainer" method="_on_register_button_pressed"]
|
|
||||||
[connection signal="pressed" from="CenterContainer/VBoxContainer/PlayButton" to="." method="_on_play_button_pressed"]
|
[connection signal="pressed" from="CenterContainer/VBoxContainer/PlayButton" to="." method="_on_play_button_pressed"]
|
||||||
[connection signal="pressed" from="CenterContainer/VBoxContainer/QuitButton" to="." method="_on_quit_button_pressed"]
|
[connection signal="pressed" from="CenterContainer/VBoxContainer/QuitButton" to="." method="_on_quit_button_pressed"]
|
||||||
[connection signal="text_submitted" from="CenterContainer/VBoxContainer/AuthTabContainer/LoginPanel/LoginUsername" to="CenterContainer/VBoxContainer/AuthTabContainer/LoginPanel/LoginButton" method="_on_login_button_pressed"]
|
[connection signal="toggled" from="CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/ModeToggle" to="." method="_on_mode_toggle_toggled"]
|
||||||
[connection signal="text_submitted" from="CenterContainer/VBoxContainer/AuthTabContainer/LoginPanel/LoginPassword" to="CenterContainer/VBoxContainer/AuthTabContainer/LoginPanel/LoginButton" method="_on_login_button_pressed"]
|
[connection signal="pressed" from="CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/AuthButton" to="." method="_on_auth_button_pressed"]
|
||||||
[connection signal="text_submitted" from="CenterContainer/VBoxContainer/AuthTabContainer/RegisterPanel/RegDob" to="CenterContainer/VBoxContainer/AuthTabContainer/RegisterPanel/RegisterButton" method="_on_register_button_pressed"]
|
[connection signal="text_submitted" from="CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/UsernameEdit" to="." method="_on_auth_button_pressed"]
|
||||||
|
[connection signal="text_submitted" from="CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/PasswordEdit" to="." method="_on_auth_button_pressed"]
|
||||||
|
|||||||
Reference in New Issue
Block a user