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")
|
||||
1
gui/buy_menu/buy_button/buy_button.gd.uid
Normal file
1
gui/buy_menu/buy_button/buy_button.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bq32y7eee1f63
|
||||
17
gui/buy_menu/buy_button/buy_button.tscn
Normal file
17
gui/buy_menu/buy_button/buy_button.tscn
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://b1ej6kmbjpm78"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dnxw4x3cmu7io" path="res://icon.svg" id="1_apu4l"]
|
||||
[ext_resource type="Script" uid="uid://bq32y7eee1f63" path="res://gui/buy_menu/buy_button/buy_button.gd" id="1_impj7"]
|
||||
|
||||
[node name="BuyButton" type="Button"]
|
||||
anchors_preset = -1
|
||||
anchor_right = 0.035
|
||||
anchor_bottom = 0.075
|
||||
offset_right = -4.799999
|
||||
offset_bottom = -14.000004
|
||||
text = "3600"
|
||||
icon = ExtResource("1_apu4l")
|
||||
icon_alignment = 1
|
||||
vertical_icon_alignment = 0
|
||||
expand_icon = true
|
||||
script = ExtResource("1_impj7")
|
||||
Loading…
Add table
Add a link
Reference in a new issue