NEO-97: refresh NPC HUD labels when combat poll stops

Re-render NpcStateLabel and TelegraphLabel when combat-active gate
turns off (e.g. Esc clear without aggro) so stale rows are cleared.
pull/136/head
VinPropane 2026-05-29 22:10:42 -04:00
parent 38fc38fde8
commit b4b7fddf3a
2 changed files with 13 additions and 0 deletions

View File

@ -1099,6 +1099,7 @@ func _update_combat_poll_gate() -> void:
return return
_combat_poll_timer.stop() _combat_poll_timer.stop()
_npc_combat_hud_needs_tick = false _npc_combat_hud_needs_tick = false
_render_npc_combat_hud_labels()
func _on_combat_poll_timeout() -> void: func _on_combat_poll_timeout() -> void:

View File

@ -57,6 +57,18 @@ func test_idle_without_lock_is_not_combat_active() -> void:
assert_that(active).is_false() assert_that(active).is_false()
func test_npc_state_label_resets_when_lock_cleared_without_aggro() -> void:
# Arrange
var cleared_target := {"lockedTargetId": null, "validity": "none"}
var rows: Dictionary = NpcCombatHudHelpers.resolve_hud_npc_rows(
cleared_target, {}, "dev-local-1"
)
# Act
var label: String = NpcCombatHudHelpers.build_npc_state_label(rows)
# Assert
assert_that(label).is_equal("NPC state: —")
func test_combat_poll_gate_stops_when_idle() -> void: func test_combat_poll_gate_stops_when_idle() -> void:
# Arrange # Arrange
var timer := Timer.new() var timer := Timer.new()