feat: surface inspected villager's open village need in field notes

This commit is contained in:
Rijad Zuzo
2026-08-10 23:36:47 +02:00
parent 8a7e6b12eb
commit 9ed985d6a3
5 changed files with 154 additions and 3 deletions
+24
View File
@@ -214,6 +214,30 @@ func _run() -> void:
),
"The interested villager should expose the open pantry need in their inspector"
)
var field_note := (
main_scene.get_node("VillagerInspectionLayer/VillagerFieldNote") as VillagerFieldNoteHud
)
contributor_visual.global_position = Vector3(-30.0, 0.0, -30.0)
var note_player := main_scene.get_node("Player") as Node3D
note_player.global_position = contributor_visual.global_position + Vector3(1.0, 0.0, 0.0)
var note_context: VillagerInspectionResult = note_player.get_nearby_villager_inspection()
_check(
(
note_context != null
and note_context.npc_id == contributor.id
and note_context.has_open_need
and note_context.need_type == SimulationIds.OPPORTUNITY_RESTOCK_EMPTY_PANTRY
and note_context.need_progress == "Food 0 / 1"
and not note_context.need_response.strip_edges().is_empty()
),
"Field note should derive the inspected villager's exact open need and response"
)
field_note.refresh_note(true)
var need_label := field_note.get_node("Copy/Need") as Label
_check(
field_note.visible and need_label.visible and "Food 0 / 1" in need_label.text,
"Field note HUD should render the surfaced need line for its interested villager"
)
village_ui.selected_npc_index = listener.id
village_ui.call("_refresh_npc_inspector")
_check(