feat: Implement Nakama serialization, Realtime API, and a comprehensive lobby system with UI and player management.

This commit is contained in:
Yogi Wiguna
2026-02-09 16:46:42 +08:00
parent a68878483f
commit bffa9474e9
7 changed files with 221 additions and 45 deletions
+14
View File
@@ -166,6 +166,9 @@ func _ready():
NakamaManager.connected_to_nakama.connect(_on_connected_to_nakama)
NakamaManager.connection_failed.connect(_on_connection_failed)
# Connect UserProfileManager signals
UserProfileManager.profile_updated.connect(_on_profile_updated)
# Show main menu initially
_show_panel("main_menu")
@@ -487,6 +490,17 @@ func _on_connection_failed(error_message: String) -> void:
connection_status.text = "Connection failed: %s" % error_message
_show_panel("main_menu")
func _on_profile_updated() -> void:
"""Handle profile updates (name/avatar change)."""
var new_name = UserProfileManager.get_display_name()
# Update input if visible
if player_name_input:
player_name_input.text = new_name
# Sync to LobbyManager if we are in a room or just locally
LobbyManager.set_player_name(new_name)
# =============================================================================
# Player Slot Updates
# =============================================================================