feat(mvp): complete M13 clean-up milestone (real usernames, avatar studio redesign, pause menu, audio manager)
checkpoint / checkpoint (push) Successful in 6m22s
checkpoint / checkpoint (push) Successful in 6m22s
This commit is contained in:
@@ -30,6 +30,10 @@ signal item_purchased(listing_id: int)
|
||||
|
||||
var _api_client: Node = null
|
||||
|
||||
var AudioManager: Node:
|
||||
get:
|
||||
return get_node_or_null("/root/AudioManager")
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
_api_client = _get_api()
|
||||
@@ -73,6 +77,12 @@ func _on_back_pressed() -> void:
|
||||
get_tree().change_scene_to_file("res://scenes/main_menu.tscn")
|
||||
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("ui_cancel"):
|
||||
get_viewport().set_input_as_handled()
|
||||
_on_back_pressed()
|
||||
|
||||
|
||||
func show_status(text: String, is_error: bool = false) -> void:
|
||||
if not status_label:
|
||||
return
|
||||
@@ -226,6 +236,7 @@ func _on_buy_clicked(listing_id: int, item_name: String, price: int) -> void:
|
||||
show_status("Purchasing '%s' for %d Buffalo Chips..." % [item_name, price])
|
||||
var res: Dictionary = await EconomyApiClient.purchase_listing(api, listing_id)
|
||||
if res.ok:
|
||||
AudioManager.play_coin()
|
||||
show_status("Successfully purchased '%s'! Item added to inventory." % item_name)
|
||||
item_purchased.emit(listing_id)
|
||||
refresh_all()
|
||||
|
||||
Reference in New Issue
Block a user