♻️REFACTOR: Mejoras en la viabilidad para desarrollo

This commit is contained in:
Diego De la Viuda Llorente committed 2026-10-29 13:23:46 +01:00
1 parent 5aba6c7b47
commit fd0118d964
98 files changed
+5985 -3024

No files matched your search

+5 -6
View File
@@ -1,27 +1,26 @@
extends CanvasLayer
## Minimal HUD showing the player's special attack charge.
##
## Expects to be a child of a Player that exposes a `special_charge_changed`
## signal, just like PlayerHealthHUD expects `health_changed`.
## Medidor de carga especial. Debe ser hijo de un jugador que emita
## special_charge_changed, igual que el HUD de vida depende de health_changed.
@onready var special_bar: ProgressBar = $HUD/SpecialBar
@onready var special_label: Label = $HUD/SpecialBar/SpecialLabel
## Conecta el medidor antes de recibir el estado inicial del jugador.
func _ready() -> void:
var player: Node = get_parent()
if player == null or not player.has_signal(&"special_charge_changed"):
push_error("SpecialChargeHUD must be a child of a Player with special_charge_changed signal.")
return
# Child _ready() runs before Player._ready(). We connect here first and the
# Player will emit its initial charge a moment later during its _ready().
# Se conecta antes del _ready del jugador para recibir tambien la carga inicial.
player.connect(&"special_charge_changed", _on_special_charge_changed)
## Actualiza la barra y la etiqueta de carga especial.
func _on_special_charge_changed(current_charge: int, max_charge: int) -> void:
special_bar.max_value = float(max_charge)
special_bar.value = float(current_charge)