Testing chip bar

This commit is contained in:
gamer147
2026-04-10 12:23:45 -04:00
parent 834d6a3a83
commit 6d9d08d78c
9 changed files with 41 additions and 14 deletions

View File

@@ -4,6 +4,8 @@ signal fight_confirmed(proposal: CombatProposal)
signal fight_cancelled
@onready var unit_panel: Control = %UnitPanel
@onready var unit_name_label: RichTextLabel = %UnitName
@onready var level_number: StylizedNumberDisplay = %LevelNumber
@onready var health_chip_bar: ChipBar = %HealthChipBar
@onready var health_number: StylizedNumberDisplay = %HealthNumber
@onready var sp_chip_bar: ChipBar = %SPChipBar
@@ -82,6 +84,8 @@ func _on_unit_selected_changed(deployed: DeployedUnit, selected: bool) -> void:
func _refresh_unit_panel() -> void:
var stats := _selected_unit.current_stats
unit_name_label.text = "[b]%s[/b]" % _selected_unit.unit.info.name
level_number.value = stats.level
health_chip_bar.max_value = stats.max_hp
health_chip_bar.value = stats.current_hp
health_number.value = stats.current_hp

View File

@@ -33,6 +33,8 @@ var lck: int:
get: return unit_stats.lck
var mov: int:
get: return unit_stats.mov
var level: int:
get: return unit_stats.level
static func from_unit_stats(source: UnitStats) -> DeployedUnitStats:
var stats := DeployedUnitStats.new()