feat: take_powerup VFX, rank fix, admin chat management
- Wire take_powerup AnimatedSprite3D on powerup pickup via add_powerup_from_item() - Make take_powerup animation one-shot (loop: false) - Fix rank Position label hidden at game start (visible = false, only shows when score > 0) - Competition ranking for tied scores in main.gd - Lobby Chat admin tab: system prefix, max messages, wipe, purge old, save config - Chat Storage admin tab: list/browse/delete individual channel messages - Backend RPCs: admin_get_chat_config, admin_set_chat_config, admin_purge_old_messages, admin_list_channel_messages, admin_delete_channel_message - Chat config applied on lobby join (max_messages, prefix injection)
This commit is contained in:
+12
-2
@@ -2262,12 +2262,22 @@ func _on_leaderboard_updated(sorted_scores: Array):
|
||||
else:
|
||||
sorted_players.sort_custom(func(a, b): return a.score > b.score)
|
||||
|
||||
# Assign rank
|
||||
# Assign rank. Players sharing a score share a rank (standard competition
|
||||
# ranking), and zero-score players get no rank at all — this prevents the
|
||||
# match from starting with everyone displaying a position.
|
||||
var prev_score = null
|
||||
var prev_rank = 0
|
||||
for i in range(sorted_players.size()):
|
||||
var p_node = sorted_players[i].node
|
||||
var p_score = sorted_players[i].score
|
||||
var rank = i + 1
|
||||
# Tie: reuse the rank of the player above with the same score.
|
||||
if prev_score != null and p_score == prev_score:
|
||||
rank = prev_rank
|
||||
prev_score = p_score
|
||||
prev_rank = rank
|
||||
if p_node.has_method("update_rank_visuals"):
|
||||
p_node.update_rank_visuals(rank)
|
||||
p_node.update_rank_visuals(rank, p_score)
|
||||
|
||||
func _on_global_timer_updated(time_remaining: float):
|
||||
"""Update the global match timer display."""
|
||||
|
||||
Reference in New Issue
Block a user