feat: add missing wood opportunities
This commit is contained in:
@@ -57,6 +57,8 @@ func initialize_world_view() -> void:
|
||||
simulation_manager.opportunity_resolved.connect(_on_opportunity_resolved)
|
||||
else:
|
||||
push_error("WorldViewManager: SimulationManager has no opportunity_resolved signal")
|
||||
if simulation_manager.has_signal("opportunity_invalidated"):
|
||||
simulation_manager.opportunity_invalidated.connect(_on_opportunity_invalidated)
|
||||
if simulation_manager.has_signal("state_restored"):
|
||||
simulation_manager.state_restored.connect(_on_simulation_state_restored)
|
||||
else:
|
||||
@@ -229,6 +231,10 @@ func _on_opportunity_resolved(
|
||||
_refresh_world_state_presentation(true)
|
||||
|
||||
|
||||
func _on_opportunity_invalidated(_opportunity: OpportunityStateRecord) -> void:
|
||||
_refresh_world_state_presentation(false)
|
||||
|
||||
|
||||
func _on_simulation_state_restored() -> void:
|
||||
for visual in active_npc_visuals.values():
|
||||
visual.queue_free()
|
||||
@@ -257,7 +263,10 @@ func _refresh_opportunity_concern() -> void:
|
||||
if visual.has_method("set_opportunity_concern_visible"):
|
||||
visual.set_opportunity_concern_visible(false)
|
||||
var opportunity: OpportunityStateRecord = simulation_manager.get_active_opportunity()
|
||||
if opportunity == null:
|
||||
if (
|
||||
opportunity == null
|
||||
or opportunity.get_opportunity_type() != SimulationIds.OPPORTUNITY_RESTOCK_EMPTY_PANTRY
|
||||
):
|
||||
return
|
||||
var interested_visual = active_npc_visuals.get(opportunity.get_interested_npc_id())
|
||||
if (
|
||||
@@ -272,5 +281,9 @@ func _sync_npc_opportunity_concern(npc_id: int, visual: Node3D) -> void:
|
||||
return
|
||||
var opportunity: OpportunityStateRecord = simulation_manager.get_active_opportunity()
|
||||
visual.set_opportunity_concern_visible(
|
||||
opportunity != null and opportunity.get_interested_npc_id() == npc_id
|
||||
(
|
||||
opportunity != null
|
||||
and opportunity.get_opportunity_type() == SimulationIds.OPPORTUNITY_RESTOCK_EMPTY_PANTRY
|
||||
and opportunity.get_interested_npc_id() == npc_id
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user