added price economy
This commit is contained in:
@@ -4,11 +4,18 @@ extends HBoxContainer
|
||||
@export var _ball_name: String
|
||||
@export var _ball_id: int
|
||||
|
||||
signal update_ball_price(new_price: int)
|
||||
|
||||
func _ready():
|
||||
$BuyButton.texture_normal = _ball_texture
|
||||
update_ball_price.connect(_on_update_ball_price)
|
||||
|
||||
func refresh_ball_price(new_price: int):
|
||||
$PriceLabel.text = "%s" % new_price
|
||||
|
||||
func _on_buy_button_pressed():
|
||||
SignalBus.on_try_buy_ball.emit(_ball_id)
|
||||
|
||||
func _on_update_ball_price(id: int, new_price: int):
|
||||
if _ball_id == id:
|
||||
$PriceLabel.text = "%s€" % new_price
|
||||
|
||||
Reference in New Issue
Block a user