summaryrefslogtreecommitdiff
path: root/scenes/stockticker/transactions.gd
blob: 98cad35cc536e0e380e672c9fa598eeaa1ceed6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
extends Node2D

## I need the signal-emitter to be the root node of this scene and when I 
## tried to just move the script it broke the stonk line so here this is I guess lol

signal buy(amount: Variant)
signal sell(amount: Variant)

func _on_stonks_buy(amount: Variant) -> void:
	print("-$%s" % amount.toString())
	buy.emit(amount)


func _on_stonks_sell(amount: Variant) -> void:
	print("+$%s" % amount.toString())
	sell.emit(amount)
	

# Scope creep!
func start():
	$Timer.start()


func set_icon(sprite: Sprite2D):
	$Node2D/Sprite2D.texture = sprite.texture


func _on_fishin_fish_chosen(fish_sprite: Sprite2D, fish_name: String) -> void:
	$Sprite2D.texture = fish_sprite.texture
	$Label.text = fish_name