From 841067989048a27f14a50240505a2614d6fea3bb Mon Sep 17 00:00:00 2001 From: adtpdn Date: Wed, 8 Jul 2026 16:32:30 +0800 Subject: [PATCH] fix(candy-survival): ensure Ghost mode button is always visible on HUD and syncs correctly on player load --- scripts/managers/candy_survival_manager.gd | 3 +++ scripts/ui/powerup_inventory_ui.gd | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/managers/candy_survival_manager.gd b/scripts/managers/candy_survival_manager.gd index ca72de2..1a300af 100644 --- a/scripts/managers/candy_survival_manager.gd +++ b/scripts/managers/candy_survival_manager.gd @@ -632,6 +632,9 @@ func sync_state_to_player(peer_id: int) -> void: # Sync Mekton's current face color if mekton_node and mekton_node.has_method("set_face_color_rpc"): mekton_node.rpc_id(peer_id, "set_face_color_rpc", current_face) + + # Sync Ghost inventory to make the HUD button visible on player load + _update_special_inventory_for_ghosts(peer_id) # Sync all players' candy stack heights and colors for pid in player_candy_colors.keys(): diff --git a/scripts/ui/powerup_inventory_ui.gd b/scripts/ui/powerup_inventory_ui.gd index 255d782..3bc29c9 100644 --- a/scripts/ui/powerup_inventory_ui.gd +++ b/scripts/ui/powerup_inventory_ui.gd @@ -199,5 +199,12 @@ func _on_inventory_updated(inventory: Dictionary): power_up_button.modulate = Color.WHITE _update_btn_shortcut(power_up_button) else: - power_up_button.visible = false - power_up_button.disabled = true + if LobbyManager.game_mode == "Candy Survival": + power_up_button.visible = true + power_up_button.icon = effect_textures.get(3) # ghost.png + power_up_button.disabled = true + power_up_button.modulate = Color(0.5, 0.5, 0.5, 0.5) + _update_btn_shortcut(power_up_button) + else: + power_up_button.visible = false + power_up_button.disabled = true