feat: update player auth, fix bugs
This commit is contained in:
@@ -80,6 +80,7 @@ func _connect_signals() -> void:
|
||||
char_right_btn.pressed.connect(func(): _cycle_loadout_char(1))
|
||||
set_default_btn.pressed.connect(_on_set_default_pressed)
|
||||
|
||||
UserProfileManager.profile_loaded.connect(func(p): _on_profile_updated())
|
||||
UserProfileManager.profile_updated.connect(_on_profile_updated)
|
||||
UserProfileManager.profile_update_failed.connect(_on_profile_update_failed)
|
||||
|
||||
@@ -172,6 +173,8 @@ func _on_set_default_pressed() -> void:
|
||||
_refresh_loadout_ui()
|
||||
# Persist to storage
|
||||
_save_loadout_to_profile()
|
||||
# Sync to leaderboard immediately
|
||||
UserProfileManager.submit_to_leaderboard()
|
||||
|
||||
func _save_loadout_to_profile() -> void:
|
||||
"""Save loadout_character field to Nakama profile storage."""
|
||||
@@ -336,7 +339,7 @@ func _setup_account_settings_ui() -> void:
|
||||
reset_stats_btn.pressed.connect(func():
|
||||
var conf = ConfirmationDialog.new()
|
||||
conf.dialog_text = "Are you SURE you want to irreversibly wipe all your stats to 0?"
|
||||
add_child(conf)
|
||||
acc_settings_dialog.add_child(conf)
|
||||
conf.popup_centered()
|
||||
conf.confirmed.connect(func():
|
||||
var r = await NakamaManager.client.rpc_async(NakamaManager.session, "reset_stats", "{}")
|
||||
@@ -376,6 +379,10 @@ func _on_close_pressed() -> void:
|
||||
emit_signal("closed")
|
||||
|
||||
func show_panel() -> void:
|
||||
if not UserProfileManager.is_profile_loaded:
|
||||
status_label.text = "Loading profile from server..."
|
||||
status_label.add_theme_color_override("font_color", Color.YELLOW)
|
||||
|
||||
_load_profile_data()
|
||||
_load_loadout()
|
||||
_check_admin_visibility()
|
||||
|
||||
Reference in New Issue
Block a user