Health bar adjustments

This commit is contained in:
2025-03-11 10:25:58 +01:00
parent 23ddace3fa
commit 43d5ee2b5f
4 changed files with 32 additions and 1 deletions

View File

@ -94,9 +94,17 @@ animations = [{
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_0gjha"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_0gjha"]
bg_color = Color(1, 0, 0, 1) bg_color = Color(1, 0, 0, 1)
corner_radius_top_left = 20
corner_radius_top_right = 20
corner_radius_bottom_right = 20
corner_radius_bottom_left = 20
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_c3t52"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_c3t52"]
bg_color = Color(0, 1, 0, 1) bg_color = Color(0, 1, 0, 1)
corner_radius_top_left = 20
corner_radius_top_right = 20
corner_radius_bottom_right = 20
corner_radius_bottom_left = 20
[node name="Cobold" type="Node2D"] [node name="Cobold" type="Node2D"]
script = ExtResource("1_ssdee") script = ExtResource("1_ssdee")

View File

@ -63,5 +63,12 @@ func set_character_data():
func adjust_health_bar() -> void: func adjust_health_bar() -> void:
var health_bar = get_node("ProgressBar") var health_bar = get_node("ProgressBar")
health_bar.value = health / current_health * 100 if current_shield > 0:
health_bar.get("theme_override_styles/fill").bg_color = Color(0,0,1)
health_bar.get("theme_override_styles/background").bg_color = Color(0,1,0)
health_bar.value = shield / current_shield * 100
else:
health_bar.get("theme_override_styles/fill").bg_color = Color(0,1,0)
health_bar.get("theme_override_styles/background").bg_color = Color(1,0,0)
health_bar.value = health / current_health * 100
pass pass

View File

@ -95,9 +95,17 @@ animations = [{
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pq2md"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pq2md"]
bg_color = Color(1, 0, 0, 1) bg_color = Color(1, 0, 0, 1)
corner_radius_top_left = 20
corner_radius_top_right = 20
corner_radius_bottom_right = 20
corner_radius_bottom_left = 20
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_gxpsl"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_gxpsl"]
bg_color = Color(0, 1, 0, 1) bg_color = Color(0, 1, 0, 1)
corner_radius_top_left = 20
corner_radius_top_right = 20
corner_radius_bottom_right = 20
corner_radius_bottom_left = 20
[node name="Forkman" type="Node2D"] [node name="Forkman" type="Node2D"]
script = ExtResource("1_pq2md") script = ExtResource("1_pq2md")

View File

@ -94,9 +94,17 @@ animations = [{
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_n3bbi"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_n3bbi"]
bg_color = Color(1, 0, 0, 1) bg_color = Color(1, 0, 0, 1)
corner_radius_top_left = 20
corner_radius_top_right = 20
corner_radius_bottom_right = 20
corner_radius_bottom_left = 20
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_2ea55"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_2ea55"]
bg_color = Color(0, 1, 0, 1) bg_color = Color(0, 1, 0, 1)
corner_radius_top_left = 20
corner_radius_top_right = 20
corner_radius_bottom_right = 20
corner_radius_bottom_left = 20
[node name="Ork" type="Node2D"] [node name="Ork" type="Node2D"]
script = ExtResource("1_1ecd4") script = ExtResource("1_1ecd4")