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
parent
bd1dd6b01f
commit
1bfa13b173
|
|
@ -1083,7 +1083,7 @@ func _is_combat_active() -> bool:
|
|||
|
||||
func _resolve_hud_npc_rows() -> Dictionary:
|
||||
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:
|
||||
_render_npc_state_label()
|
||||
_render_telegraph_label()
|
||||
_npc_combat_hud_needs_tick = _has_interpolated_telegraph_display()
|
||||
|
||||
|
||||
func _has_interpolated_telegraph_display() -> bool:
|
||||
return NpcCombatHudHelpers.has_interpolated_telegraph_display(
|
||||
_resolve_hud_npc_rows(), _npc_runtime_hud_state
|
||||
var rows: Dictionary = _resolve_hud_npc_rows()
|
||||
_render_npc_state_label(rows)
|
||||
_render_telegraph_label(rows)
|
||||
_npc_combat_hud_needs_tick = NpcCombatHudHelpers.has_interpolated_telegraph_display(
|
||||
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):
|
||||
return
|
||||
_npc_state_label.text = NpcCombatHudHelpers.build_npc_state_label(
|
||||
_resolve_hud_npc_rows(), _npc_runtime_sync_error
|
||||
)
|
||||
_npc_state_label.text = NpcCombatHudHelpers.build_npc_state_label(rows, _npc_runtime_sync_error)
|
||||
|
||||
|
||||
func _render_telegraph_label() -> void:
|
||||
func _render_telegraph_label(rows: Dictionary) -> void:
|
||||
if not is_instance_valid(_telegraph_label):
|
||||
return
|
||||
_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
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -35,11 +35,17 @@ static func is_combat_active(
|
|||
|
||||
|
||||
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:
|
||||
var lock_id := locked_target_id_from_state(last_target_state)
|
||||
var locked_row: Dictionary = {}
|
||||
if is_known_npc_id(lock_id):
|
||||
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 aggro_row: Dictionary = incoming_aggro_row(dev_player_id, npc_runtime_snapshot)
|
||||
|
|
|
|||
Loading…
Reference in New Issue