From 5c91bb3f3460bac742740c5fd2b1589bbdf602ec Mon Sep 17 00:00:00 2001 From: coder-bot Date: Wed, 19 Aug 2026 16:01:14 +0000 Subject: [PATCH] WIP checkpoint: Implementation: Login/Register UI wired to /api/auth --- scenes/main_menu.tscn | 91 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/scenes/main_menu.tscn b/scenes/main_menu.tscn index dd4847f..07193d1 100644 --- a/scenes/main_menu.tscn +++ b/scenes/main_menu.tscn @@ -29,6 +29,92 @@ text = "AGP Game" horizontal_alignment = 1 theme_override_font_sizes/font_size = 72 +[node name="AuthTabContainer" type="TabContainer" parent="CenterContainer/VBoxContainer"] +layout_mode = 1 +size_flags_horizontal = 4 +tabs = "Login\0Register" + +[node name="LoginPanel" type="VBoxContainer" parent="CenterContainer/VBoxContainer/AuthTabContainer"] +layout_mode = 1 +theme_override_constants/separation = 8 +size_flags_horizontal = 4 + +[node name="LoginUsernameLabel" type="Label" parent="CenterContainer/VBoxContainer/AuthTabContainer/LoginPanel"] +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 +text = "Login" +size_flags_horizontal = 4 + +[node name="RegisterPanel" type="VBoxContainer" parent="CenterContainer/VBoxContainer/AuthTabContainer"] +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" + +[node name="RegEmailLabel" type="Label" parent="CenterContainer/VBoxContainer/AuthTabContainer/RegisterPanel"] +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" +secret = true + +[node name="RegDobLabel" type="Label" parent="CenterContainer/VBoxContainer/AuthTabContainer/RegisterPanel"] +layout_mode = 1 +text = "Date of Birth (YYYY-MM-DD)" + +[node name="RegDob" type="LineEdit" parent="CenterContainer/VBoxContainer/AuthTabContainer/RegisterPanel"] +layout_mode = 1 +size_flags_horizontal = 4 +placeholder_text = "YYYY-MM-DD" + +[node name="RegisterButton" type="Button" parent="CenterContainer/VBoxContainer/AuthTabContainer/RegisterPanel"] +layout_mode = 1 +text = "Register" +size_flags_horizontal = 4 + +[node name="ErrorLabel" type="Label" parent="CenterContainer/VBoxContainer"] +layout_mode = 1 +size_flags_horizontal = 4 +text = "" +font_color = Color(1, 0, 0, 1) +visible = false + +[node name="UserInfoLabel" type="Label" parent="CenterContainer/VBoxContainer"] +layout_mode = 1 +size_flags_horizontal = 4 +text = "" +visible = false + [node name="PlayButton" type="Button" parent="CenterContainer/VBoxContainer"] layout_mode = 1 text = "Play" @@ -39,5 +125,10 @@ layout_mode = 1 text = "Quit" 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/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="text_submitted" from="CenterContainer/VBoxContainer/AuthTabContainer/LoginPanel/LoginPassword" to="CenterContainer/VBoxContainer/AuthTabContainer/LoginPanel/LoginButton" method="_on_login_button_pressed"] +[connection signal="text_submitted" from="CenterContainer/VBoxContainer/AuthTabContainer/RegisterPanel/RegDob" to="CenterContainer/VBoxContainer/AuthTabContainer/RegisterPanel/RegisterButton" method="_on_register_button_pressed"]