From b4b7fddf3acd0dfe8b8571c2139cca2ec37ceb32 Mon Sep 17 00:00:00 2001 From: VinPropane Date: Fri, 29 May 2026 22:10:42 -0400 Subject: [PATCH] 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. --- client/scripts/main.gd | 1 + client/test/npc_combat_hud_refresh_test.gd | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/client/scripts/main.gd b/client/scripts/main.gd index b90902d..e0c8d64 100644 --- a/client/scripts/main.gd +++ b/client/scripts/main.gd @@ -1099,6 +1099,7 @@ func _update_combat_poll_gate() -> void: return _combat_poll_timer.stop() _npc_combat_hud_needs_tick = false + _render_npc_combat_hud_labels() func _on_combat_poll_timeout() -> void: diff --git a/client/test/npc_combat_hud_refresh_test.gd b/client/test/npc_combat_hud_refresh_test.gd index e031e07..b3e6ee9 100644 --- a/client/test/npc_combat_hud_refresh_test.gd +++ b/client/test/npc_combat_hud_refresh_test.gd @@ -57,6 +57,18 @@ func test_idle_without_lock_is_not_combat_active() -> void: 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: # Arrange var timer := Timer.new()