feat: edit some login indicator
This commit is contained in:
+28
-8
@@ -2,6 +2,8 @@ extends Control
|
||||
|
||||
# UI References - Main Menu
|
||||
@onready var main_menu_panel = $MainMenuPanel
|
||||
@onready var main_title = $MainMenuPanel/VBoxContainer/TitleContainer/Title
|
||||
@onready var main_subtitle = $MainMenuPanel/VBoxContainer/TitleContainer/Subtitle
|
||||
@onready var create_room_btn = $MainMenuPanel/VBoxContainer/ButtonSection/CreateRoomBtn
|
||||
@onready var browse_rooms_btn = $MainMenuPanel/VBoxContainer/ButtonSection/BrowseRoomsBtn
|
||||
@onready var main_menu_profile_btn = $MainMenuPanel/VBoxContainer/ButtonSection/ProfileBtn
|
||||
@@ -116,11 +118,8 @@ func _ready():
|
||||
# Setup Game Mode specific UI dynamically
|
||||
_create_custom_settings_ui()
|
||||
|
||||
# Set player name from profile
|
||||
if AuthManager.is_guest:
|
||||
LobbyManager.local_player_name = NameGenerator.generate_guest_name()
|
||||
else:
|
||||
LobbyManager.local_player_name = UserProfileManager.get_display_name()
|
||||
# Initial UI update
|
||||
_on_profile_updated()
|
||||
|
||||
# Connect button signals - Main Menu
|
||||
create_room_btn.pressed.connect(_on_create_room_pressed)
|
||||
@@ -208,8 +207,12 @@ func _ready():
|
||||
NakamaManager.connection_failed.connect(_on_connection_failed)
|
||||
|
||||
# Connect UserProfileManager signals
|
||||
UserProfileManager.profile_loaded.connect(func(_p): _on_profile_updated())
|
||||
UserProfileManager.profile_updated.connect(_on_profile_updated)
|
||||
|
||||
# Set initial title if already loaded
|
||||
_on_profile_updated()
|
||||
|
||||
# Show main menu initially
|
||||
_show_panel("main_menu")
|
||||
|
||||
@@ -239,6 +242,9 @@ func _load_character_textures() -> void:
|
||||
print("[Lobby] Character texture not found: ", tex_path)
|
||||
|
||||
func _on_server_option_selected(index: int) -> void:
|
||||
if main_subtitle and server_option:
|
||||
main_subtitle.text = server_option.get_item_text(index).to_upper()
|
||||
|
||||
if index == 0:
|
||||
# Nakama Localhost
|
||||
if server_ip_input: server_ip_input.visible = false
|
||||
@@ -805,10 +811,24 @@ func _on_connection_failed(error_message: String) -> void:
|
||||
|
||||
func _on_profile_updated() -> void:
|
||||
"""Handle profile updates (name/avatar change)."""
|
||||
var new_name = UserProfileManager.get_display_name()
|
||||
var display_name: String = ""
|
||||
|
||||
# Sync to LobbyManager if we are in a room or just locally
|
||||
LobbyManager.set_player_name(new_name)
|
||||
if UserProfileManager.is_profile_loaded:
|
||||
display_name = UserProfileManager.get_display_name()
|
||||
elif not AuthManager.is_guest and AuthManager.is_authenticated:
|
||||
display_name = "LOADING..."
|
||||
else:
|
||||
# Is Guest or not logged in yet
|
||||
if LobbyManager.local_player_name.is_empty() or LobbyManager.local_player_name == "Guest":
|
||||
display_name = NameGenerator.generate_guest_name()
|
||||
else:
|
||||
display_name = LobbyManager.local_player_name
|
||||
|
||||
if main_title:
|
||||
main_title.text = display_name
|
||||
|
||||
# Sync to LobbyManager
|
||||
LobbyManager.set_player_name(display_name)
|
||||
|
||||
# =============================================================================
|
||||
# Player Slot Updates
|
||||
|
||||
@@ -58,11 +58,18 @@ layout_mode = 2
|
||||
|
||||
[node name="BackBtn" type="Button" parent="MainLayout/LeftPanel/LeftVBox/Header" unique_id=1330539196]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(44, 44)
|
||||
custom_minimum_size = Vector2(100, 44)
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = ExtResource("3_font")
|
||||
text = "← BACK"
|
||||
|
||||
[node name="RefreshBtn" type="Button" parent="MainLayout/LeftPanel/LeftVBox/Header"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(44, 44)
|
||||
layout_mode = 2
|
||||
tooltip_text = "Refresh Data"
|
||||
text = "⟳"
|
||||
|
||||
[node name="Title" type="Label" parent="MainLayout/LeftPanel/LeftVBox/Header" unique_id=1037998429]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
@@ -175,22 +182,35 @@ root_node = NodePath("../Oldpop")
|
||||
libraries/animation-pack = ExtResource("5_animlib")
|
||||
autoplay = &"animation-pack/idle"
|
||||
|
||||
[node name="SelectedPlayerInfo" type="VBoxContainer" parent="MainLayout/RightPanel" unique_id=1592883771]
|
||||
[node name="SelectedPlayerInfo" type="PanelContainer" parent="MainLayout/RightPanel" unique_id=1592883771]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 8
|
||||
|
||||
[node name="InfoMargin" type="MarginContainer" parent="MainLayout/RightPanel/SelectedPlayerInfo"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 20
|
||||
theme_override_constants/margin_right = 20
|
||||
theme_override_constants/margin_top = 15
|
||||
theme_override_constants/margin_bottom = 15
|
||||
|
||||
[node name="InfoVBox" type="VBoxContainer" parent="MainLayout/RightPanel/SelectedPlayerInfo/InfoMargin"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 4
|
||||
|
||||
[node name="SelectedNameLabel" type="Label" parent="MainLayout/RightPanel/SelectedPlayerInfo" unique_id=1940372038]
|
||||
[node name="SelectedNameLabel" type="Label" parent="MainLayout/RightPanel/SelectedPlayerInfo/InfoMargin/InfoVBox" unique_id=1940372038]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_fonts/font = ExtResource("3_font")
|
||||
theme_override_font_sizes/font_size = 20
|
||||
theme_override_font_sizes/font_size = 24
|
||||
text = "PLAYER NAME"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="SelectedRankLabel" type="Label" parent="MainLayout/RightPanel/SelectedPlayerInfo" unique_id=994755781]
|
||||
[node name="SelectedRankLabel" type="Label" parent="MainLayout/RightPanel/SelectedPlayerInfo/InfoMargin/InfoVBox" unique_id=994755781]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.647, 0.996, 0.224, 1)
|
||||
theme_override_fonts/font = ExtResource("3_font")
|
||||
theme_override_font_sizes/font_size = 14
|
||||
theme_override_font_sizes/font_size = 16
|
||||
text = "RANK #1"
|
||||
horizontal_alignment = 1
|
||||
|
||||
Reference in New Issue
Block a user