15 lines
462 B
GDScript
15 lines
462 B
GDScript
extends VBoxContainer
|
|
|
|
func _ready() -> void:
|
|
Economy.production_log.connect(append)
|
|
|
|
func append(producer: Currency, production: Production):
|
|
var display := preload("res://gui/production_log.tscn").instantiate()
|
|
display.set_color(Color.YELLOW)
|
|
for child in get_children():
|
|
if child is ProductionLog and child.is_old:
|
|
child.set_color(Color.WHITE)
|
|
display.producer = producer
|
|
display.production = production
|
|
add_child(display)
|
|
move_child(display, 0)
|