feat: add simulation garden demo controls

This commit is contained in:
2026-07-07 15:56:24 +02:00
parent b0bad6c467
commit 4bfc09d5f6
9 changed files with 124 additions and 6 deletions
+11 -1
View File
@@ -9,6 +9,7 @@ const DEBUG_LOGS := false
var selected_npc_index := 0
var inspector_refresh_accumulator := 0.0
var debug_overlay_visible := true
func _ready() -> void:
@@ -88,6 +89,8 @@ func _on_state_restored() -> void:
func _refresh_npc_inspector() -> void:
if not debug_overlay_visible:
return
if simulation_manager == null or simulation_manager.npcs.is_empty():
npc_inspector_label.text = "No villagers available"
return
@@ -122,7 +125,7 @@ func _refresh_npc_inspector() -> void:
+ "Hunger: %.0f Energy: %.0f\n"
+ "Carrying food: %.0f\n\n"
+ "Why\n%s%s\n\n"
+ "[Tab] Next villager"
+ "[Tab] Next villager [F10] Cinematic/debug [F12] Demo reset"
) % [
npc.npc_name,
profession_name,
@@ -146,3 +149,10 @@ func _get_action_name(action_id: StringName) -> String:
if definition != null:
return definition.display_name
return String(action_id).capitalize()
func set_debug_overlay_visible(is_visible: bool) -> void:
debug_overlay_visible = is_visible
visible = is_visible
if is_visible:
_refresh_npc_inspector()