everything_has_a_price_jam/gui/production_ledger.gd
2026-09-27 13:48:31 -06:00

18 lines
548 B
GDScript

extends VBoxContainer
@export var new_message_color: Color
@export var old_message_color: Color
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(new_message_color)
for child in get_children():
if child is ProductionLog and child.is_old:
child.set_color(old_message_color)
display.producer = producer
display.production = production
add_child(display)
move_child(display, 0)