everything_has_a_price_jam/gui/production_chart.gd
2026-09-26 23:54:33 -06:00

16 lines
453 B
GDScript

extends VBoxContainer
func _ready() -> void:
Economy.productions_update.connect(sync)
UserContext.modal_command_change.connect(modal_command_change)
func modal_command_change(c: Command):
visible = c == null
func sync(productions: Array[Production]):
for child in get_children():
child.queue_free()
for p in productions:
var display := preload("res://gui/production_display.tscn").instantiate()
display.production = p
add_child(display)