extends Node

var wheat: int = 0
var disable_leaderboards: bool = false
@onready var wheat_label: Label = $"../../../UILayer/UI/Wheat/HBoxContainer/Label"
@onready var no_time_for_signals = $"../../../UILayer/UI/Plants"

func _ready():
    disable_leaderboards = false
    add(19)
    
func _input(event: InputEvent):
    if event.is_action_pressed("cash_cheat"):
        disable_leaderboards = true
        add(10)

func add(count: int) -> bool:
    wheat += count
    if wheat < 0:
        wheat -= count
        return false
    wheat_label.set_text(str(wheat))
    for i in no_time_for_signals.get_children():
        i.updoot(wheat)
    return true
