feat: add person history and trust reactions
This commit is contained in:
@@ -40,6 +40,10 @@ func initialize_world_view() -> void:
|
||||
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("relationship_changed"):
|
||||
simulation_manager.relationship_changed.connect(_on_relationship_changed)
|
||||
else:
|
||||
push_error("WorldViewManager: SimulationManager has no relationship_changed signal")
|
||||
if simulation_manager.has_signal("state_restored"):
|
||||
simulation_manager.state_restored.connect(_on_simulation_state_restored)
|
||||
else:
|
||||
@@ -182,6 +186,20 @@ func _on_npc_task_changed(npc: SimNPC, _old_task: StringName, _new_task: StringN
|
||||
push_error("WorldViewManager: NPCVisual has no set_task_presentation method")
|
||||
|
||||
|
||||
func _on_relationship_changed(
|
||||
relationship: RelationshipStateRecord, _cause_event: EconomicEventRecord
|
||||
) -> void:
|
||||
if relationship == null:
|
||||
return
|
||||
var visual = active_npc_visuals.get(relationship.get_observer_id())
|
||||
if visual == null:
|
||||
return
|
||||
if visual.has_method("play_trust_gain_reaction"):
|
||||
visual.play_trust_gain_reaction()
|
||||
else:
|
||||
push_error("WorldViewManager: NPCVisual has no play_trust_gain_reaction method")
|
||||
|
||||
|
||||
func _on_simulation_state_restored() -> void:
|
||||
for visual in active_npc_visuals.values():
|
||||
visual.queue_free()
|
||||
|
||||
Reference in New Issue
Block a user