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:
@@ -27,6 +27,9 @@ signal back_requested
|
||||
@onready var page_label: Label = $VBox/LedgerSection/PagingHBox/PageLabel
|
||||
|
||||
var _api_client: Node = null
|
||||
var AudioManager: Node:
|
||||
get:
|
||||
return get_node_or_null("/root/AudioManager")
|
||||
var current_page: int = 0
|
||||
const PAGE_SIZE: int = 20
|
||||
var total_tx_count: int = 0
|
||||
@@ -72,6 +75,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
|
||||
@@ -123,6 +132,7 @@ func _buy_pack(credits: int) -> void:
|
||||
show_status("Processing purchase of %d Buffalo Chips..." % credits)
|
||||
var res: Dictionary = await EconomyApiClient.purchase_credits(api, credits)
|
||||
if res.ok and res.data is Dictionary:
|
||||
AudioManager.play_coin()
|
||||
var new_bal: int = int(res.data.get("new_balance", 0))
|
||||
if balance_label:
|
||||
balance_label.text = "%d Buffalo Chips" % new_bal
|
||||
|
||||
Reference in New Issue
Block a user