From abf562ee7d7d7deb81e1e40c6710f1b11b077324 Mon Sep 17 00:00:00 2001 From: Zoey Kitt Date: Sat, 16 Nov 2024 13:16:05 -0600 Subject: Add transaction signal --- scenes/stockticker/stonks.gd | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scenes/stockticker') diff --git a/scenes/stockticker/stonks.gd b/scenes/stockticker/stonks.gd index 508fb82..96ea000 100644 --- a/scenes/stockticker/stonks.gd +++ b/scenes/stockticker/stonks.gd @@ -1,5 +1,7 @@ extends Node2D +signal transaction(amount: float) + const MAX_PRICES = 15 const Y_START = 60 @@ -158,6 +160,7 @@ func _on_buy_button_button_up() -> void: shares += 1 shares_label.text = "Shares\nHeld:%d" % shares hype_mult += hype_inc + transaction.emit(-prev_price) func _on_sell_button_button_up() -> void: @@ -165,3 +168,4 @@ func _on_sell_button_button_up() -> void: shares -= 1 shares_label.text = "Shares\nHeld:%d" % shares panic_mult += panic_inc + transaction.emit(prev_price) -- cgit v1.2.3