feat: add cinematic npc task glyphs
This commit is contained in:
@@ -36,6 +36,10 @@ func initialize_world_view() -> void:
|
||||
simulation_manager.npc_inventory_changed.connect(_on_npc_inventory_changed)
|
||||
else:
|
||||
push_error("WorldViewManager: SimulationManager has no npc_inventory_changed signal")
|
||||
if simulation_manager.has_signal("npc_task_changed"):
|
||||
simulation_manager.npc_task_changed.connect(_on_npc_task_changed)
|
||||
else:
|
||||
push_error("WorldViewManager: SimulationManager has no npc_task_changed signal")
|
||||
if simulation_manager.has_signal("state_restored"):
|
||||
simulation_manager.state_restored.connect(_on_simulation_state_restored)
|
||||
else:
|
||||
@@ -168,6 +172,16 @@ func _on_npc_inventory_changed(npc: SimNPC, item_id: StringName, amount: float)
|
||||
push_error("WorldViewManager: NPCVisual has no set_carried_food_visible method")
|
||||
|
||||
|
||||
func _on_npc_task_changed(npc: SimNPC, _old_task: StringName, _new_task: StringName) -> void:
|
||||
var visual = active_npc_visuals.get(npc.id)
|
||||
if visual == null:
|
||||
return
|
||||
if visual.has_method("set_task_presentation"):
|
||||
visual.set_task_presentation(npc.current_task, npc.task_state)
|
||||
else:
|
||||
push_error("WorldViewManager: NPCVisual has no set_task_presentation method")
|
||||
|
||||
|
||||
func _on_simulation_state_restored() -> void:
|
||||
for visual in active_npc_visuals.values():
|
||||
visual.queue_free()
|
||||
|
||||
Reference in New Issue
Block a user