summaryrefslogtreecommitdiff
path: root/scenes/stockticker
diff options
context:
space:
mode:
authorZoey Kitt <zoey.kitt@outlook.com>2024-11-16 13:16:05 -0600
committerZoey Kitt <zoey.kitt@outlook.com>2024-11-16 13:16:05 -0600
commitabf562ee7d7d7deb81e1e40c6710f1b11b077324 (patch)
tree72dc0456ba2aa13efe81980629d726aa77194ec0 /scenes/stockticker
parent606c1714c654cb247a70c23b335a0aeca91c4c52 (diff)
Add transaction signal
Diffstat (limited to 'scenes/stockticker')
-rw-r--r--scenes/stockticker/stonks.gd4
1 files changed, 4 insertions, 0 deletions
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)