NEO-97: address Bugbot HUD row lookup and reuse

Resolve HUD npc rows once per render tick; wire production locked-row
lookup through NpcRuntimeClient.npc_row for last-snapshot fallback.
pull/136/head
VinPropane 2026-05-29 21:45:17 -04:00
parent bd1dd6b01f
commit 1bfa13b173
2 changed files with 18 additions and 17 deletions

View File

@ -1083,7 +1083,7 @@ func _is_combat_active() -> bool:
func _resolve_hud_npc_rows() -> Dictionary: func _resolve_hud_npc_rows() -> Dictionary:
return NpcCombatHudHelpers.resolve_hud_npc_rows( return NpcCombatHudHelpers.resolve_hud_npc_rows(
_last_target_state, _npc_runtime_snapshot, _dev_player_id() _last_target_state, _npc_runtime_snapshot, _dev_player_id(), _npc_runtime_client
) )
@ -1158,30 +1158,25 @@ func _render_player_combat_hp_label() -> void:
func _render_npc_combat_hud_labels() -> void: func _render_npc_combat_hud_labels() -> void:
_render_npc_state_label() var rows: Dictionary = _resolve_hud_npc_rows()
_render_telegraph_label() _render_npc_state_label(rows)
_npc_combat_hud_needs_tick = _has_interpolated_telegraph_display() _render_telegraph_label(rows)
_npc_combat_hud_needs_tick = NpcCombatHudHelpers.has_interpolated_telegraph_display(
rows, _npc_runtime_hud_state
func _has_interpolated_telegraph_display() -> bool:
return NpcCombatHudHelpers.has_interpolated_telegraph_display(
_resolve_hud_npc_rows(), _npc_runtime_hud_state
) )
func _render_npc_state_label() -> void: func _render_npc_state_label(rows: Dictionary) -> void:
if not is_instance_valid(_npc_state_label): if not is_instance_valid(_npc_state_label):
return return
_npc_state_label.text = NpcCombatHudHelpers.build_npc_state_label( _npc_state_label.text = NpcCombatHudHelpers.build_npc_state_label(rows, _npc_runtime_sync_error)
_resolve_hud_npc_rows(), _npc_runtime_sync_error
)
func _render_telegraph_label() -> void: func _render_telegraph_label(rows: Dictionary) -> void:
if not is_instance_valid(_telegraph_label): if not is_instance_valid(_telegraph_label):
return return
_telegraph_label.text = NpcCombatHudHelpers.build_telegraph_label( _telegraph_label.text = NpcCombatHudHelpers.build_telegraph_label(
_resolve_hud_npc_rows(), _npc_runtime_hud_state, _npc_runtime_sync_error rows, _npc_runtime_hud_state, _npc_runtime_sync_error
) )

View File

@ -35,12 +35,18 @@ static func is_combat_active(
static func resolve_hud_npc_rows( static func resolve_hud_npc_rows(
last_target_state: Dictionary, npc_runtime_snapshot: Dictionary, dev_player_id: String last_target_state: Dictionary,
npc_runtime_snapshot: Dictionary,
dev_player_id: String,
runtime_client: Node = null
) -> Dictionary: ) -> Dictionary:
var lock_id := locked_target_id_from_state(last_target_state) var lock_id := locked_target_id_from_state(last_target_state)
var locked_row: Dictionary = {} var locked_row: Dictionary = {}
if is_known_npc_id(lock_id): if is_known_npc_id(lock_id):
locked_row = NpcRuntimeClient.npc_row_in_snapshot(lock_id, npc_runtime_snapshot) if is_instance_valid(runtime_client) and runtime_client.has_method("npc_row"):
locked_row = runtime_client.call("npc_row", lock_id, npc_runtime_snapshot) as Dictionary
else:
locked_row = NpcRuntimeClient.npc_row_in_snapshot(lock_id, npc_runtime_snapshot)
var incoming_row: Dictionary = {} var incoming_row: Dictionary = {}
var aggro_row: Dictionary = incoming_aggro_row(dev_player_id, npc_runtime_snapshot) var aggro_row: Dictionary = incoming_aggro_row(dev_player_id, npc_runtime_snapshot)
if not aggro_row.is_empty(): if not aggro_row.is_empty():