Global refactor
This commit is contained in:
parent
3868af29e3
commit
0589ca4e23
180 changed files with 249 additions and 401 deletions
15
gui/buy_menu/buy_button/buy_button.gd
Normal file
15
gui/buy_menu/buy_button/buy_button.gd
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
extends Button
|
||||
|
||||
@export var weapon: WeaponResource
|
||||
|
||||
func _ready() -> void:
|
||||
icon = weapon.preview
|
||||
text = str(weapon.cost)
|
||||
|
||||
func _pressed() -> void:
|
||||
var player_data = Session.get_player_data()
|
||||
if player_data["money"] >= weapon.cost:
|
||||
var player: Player = Session.player_nodes[multiplayer.get_unique_id()]
|
||||
|
||||
player_data["money"] -= weapon.cost
|
||||
player.get_node("WeaponSystem").add(weapon.weapon_system_scene.instantiate(),"ability_first")
|
||||
Loading…
Add table
Add a link
Reference in a new issue