extends Control var currency: Currency = null func _ready() -> void: UserContext.currency_inspect.connect(currency_inspect) update() func currency_inspect(c: Currency): currency = c update() func update(): if currency == null: visible = false return visible = true %InspectedCurrency.text = currency.name %CurrencyDescription.text = currency.description for child in %ProductionsList.get_children(): child.queue_free() for production in currency.production: var display := preload("res://gui/production_display.tscn").instantiate() display.production = production %ProductionsList.add_child(display) func _on_close_button_pressed() -> void: visible = false