enabled enforced static typing

This commit is contained in:
2024-02-22 06:22:22 +11:00
parent e1a867d2a9
commit a93660f755
1645 changed files with 24730 additions and 2078 deletions

View File

@ -1,24 +1,24 @@
extends TextureProgressBar
class_name HealthBar extends TextureProgressBar
@export var health_bar_gradient: Gradient
@onready var prev_bar = $PreviousHealthBar
@onready var prev_bar: TextureProgressBar = $PreviousHealthBar
func setup(health: float):
func setup(health: float) -> void:
max_value = health
value = health
prev_bar.max_value = health
prev_bar.value = health
func on_health_changed(health: float):
func on_health_changed(health: float) -> void:
set_visible(true)
var health_went_down = true if health < value else false
var health_went_down: bool = true if health < value else false
value = health
tint_progress = health_bar_gradient.sample(value / max_value)
if health_went_down:
var tween = create_tween()
var tween: Tween = create_tween()
tween.set_ease(Tween.EASE_OUT)
tween.set_trans(Tween.TRANS_QUINT)
tween.tween_interval(0.3)