Merge main into agent/28357bca192d to resolve PR #43 conflicts

# Conflicts:
#	scripts/main_menu.gd
This commit is contained in:
claude-checkpoint-tooling
2026-08-20 16:43:48 +00:00
3 changed files with 87 additions and 33 deletions
+12 -19
View File
@@ -3,8 +3,9 @@ extends Control
##
## The AuthPanel is hidden by default. When the user clicks the LoginButton or
## RegisterButton (AuthButtonsRow, above the panel), the auth panel slides in.
## The ModeToggle switches between Login and Register modes, showing/hiding
## the email and DOB fields accordingly.
## The Login and Register buttons on the AuthButtonsRow directly set the panel's
## mode, so the user can switch between Login and Register at any time while
## the panel is open.
##
## On successful auth the token is stored via ApiClient, AuthButtonsRow hides,
## the welcome label shows the username, and the Play button becomes enabled.
@@ -34,7 +35,6 @@ var _username_edit: LineEdit
var _password_edit: LineEdit
var _email_edit: LineEdit
var _dob_edit: LineEdit
var _mode_toggle: CheckButton
var _auth_button: Button
var _status_label: Label
var _welcome_label: Label
@@ -58,7 +58,6 @@ func _ready() -> void:
_password_edit = $CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/PasswordEdit
_email_edit = $CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/EmailEdit
_dob_edit = $CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/DOBEdit
_mode_toggle = $CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/ModeToggle
_auth_button = $CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/AuthButton
_status_label = $CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/AuthStatusLabel
_welcome_label = $CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/WelcomeLabel
@@ -108,7 +107,7 @@ func _reset_to_logged_out() -> void:
_update_auth_mode_ui()
# ─── Play / Quit ─────────────────────────────────────────────────────────────
# ─── Play / Quit ──────────────────────────────────────────────────────────────
func _on_play_button_pressed() -> void:
if _play_button.disabled:
@@ -122,11 +121,14 @@ func _on_quit_button_pressed() -> void:
get_tree().quit()
# ─── Auth panel toggle ───────────────────────────────────────────────────────
# ─── Auth panel toggle ────────────────────────────────────────────────────────
func _on_login_button_pressed() -> void:
"""Show the auth panel, called from AuthButtonsRow/LoginButton."""
"""Show the auth panel in login mode, called from AuthButtonsRow/LoginButton."""
_auth_panel.visible = true
_is_register_mode = false
_update_auth_mode_ui()
_clear_status()
_username_edit.grab_focus()
@@ -134,20 +136,11 @@ func _on_register_button_pressed() -> void:
"""Show the auth panel in register mode, called from AuthButtonsRow/RegisterButton."""
_auth_panel.visible = true
_is_register_mode = true
_mode_toggle.button_pressed = true
_update_auth_mode_ui()
_clear_status()
_username_edit.grab_focus()
# ─── Mode toggle (Login / Register) ──────────────────────────────────────────
func _on_mode_toggle_toggled(button_pressed: bool) -> void:
_is_register_mode = button_pressed
_update_auth_mode_ui()
_clear_status()
func _update_auth_mode_ui() -> void:
"""Update labels and field visibility based on login vs register mode."""
if _is_register_mode:
@@ -162,7 +155,7 @@ func _update_auth_mode_ui() -> void:
_dob_edit.visible = false
# ─── Auth submission ─────────────────────────────────────────────────────────
# ─── Auth submission ──────────────────────────────────────────────────────────
func _on_auth_button_pressed() -> void:
"""Handle login or register button press."""
@@ -233,7 +226,7 @@ func _on_auth_complete(result: Dictionary) -> void:
_show_status(result.detail)
# ─── Status helpers ──────────────────────────────────────────────────────────
# ─── Status helpers ───────────────────────────────────────────────────────────
func _show_status(message: String) -> void:
_status_label.text = message
@@ -245,7 +238,7 @@ func _clear_status() -> void:
_status_label.visible = false
# ─── Validation ──────────────────────────────────────────────────────────────
# ─── Validation ───────────────────────────────────────────────────────────────
func _is_valid_date(date_str: String) -> bool:
"""Check if a string looks like a valid YYYY-MM-DD date."""