diff --git a/game/player/NamePlate.gd b/game/player/NamePlate.gd index f733affa..dc84eaa0 100644 --- a/game/player/NamePlate.gd +++ b/game/player/NamePlate.gd @@ -123,11 +123,11 @@ func set_max_distance(var value : float) -> void: max_distance = value func c_health_changed(stat : EntityResource) -> void: - if stat.current_value != 0: - health_bar.max_value = stat.max_value - else: + if stat.max_value == 0: health_bar.max_value = 1 + health_bar.value = 0 + health_bar.max_value = stat.max_value health_bar.value = stat.current_value @@ -173,3 +173,4 @@ func on_centity_resource_added(resorce) -> void: health = entity.getc_health() health.connect("changed", self, "c_health_changed") + c_health_changed(health) diff --git a/game/ui/nameplates/NamePlate.tscn b/game/ui/nameplates/NamePlate.tscn index e62c202b..43518ef3 100644 --- a/game/ui/nameplates/NamePlate.tscn +++ b/game/ui/nameplates/NamePlate.tscn @@ -41,7 +41,7 @@ margin_right = 62.0 margin_bottom = 2.0 size_flags_horizontal = 3 size_flags_vertical = 3 -value = 50.0 +value = 100.0 texture_under = ExtResource( 2 ) texture_progress = ExtResource( 2 ) tint_under = Color( 0.219608, 0.215686, 0.215686, 0.756863 )