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
parent
38fc38fde8
commit
b4b7fddf3a
|
|
@ -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:
|
||||||
|
|
|
||||||
|
|
@ -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()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue