25 lines
630 B
GDScript
25 lines
630 B
GDScript
extends Control
|
|
|
|
@export var producer: Currency = null
|
|
@export var production: Production
|
|
|
|
func _ready() -> void:
|
|
if producer != null:
|
|
%producer.text = producer.name
|
|
%Production.visible = true
|
|
%Production2.visible = false
|
|
else:
|
|
%Production.visible = false
|
|
%Production2.visible = true
|
|
%amount.text = str(abs(production.amount))
|
|
%amount2.text = str(abs(production.amount))
|
|
if production.amount > 0:
|
|
%type.text = "produced"
|
|
%producer2.text = "You gained"
|
|
else:
|
|
%type.text = "consumed"
|
|
%producer2.text = "You lost"
|
|
|
|
%production.text = production.currency.name
|
|
%production2.text = production.currency.name
|
|
|