16 lines
453 B
GDScript
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)
|