feature complete prototype almost done!
This commit is contained in:
parent
93cc1a8c59
commit
af8662fd6a
21 changed files with 327 additions and 41 deletions
39
inv_system/botnet/botnet_panel.gd
Normal file
39
inv_system/botnet/botnet_panel.gd
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
extends Inventory
|
||||
|
||||
@export var install_button : Button
|
||||
@export var score_label : Label
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
super()
|
||||
check_server()
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
super(delta)
|
||||
score_label.text = str(PlayerInventory.botnet_servers)
|
||||
pass
|
||||
|
||||
func _notification(what: int) -> void:
|
||||
super(what)
|
||||
if what == Node.NOTIFICATION_DRAG_END:
|
||||
check_server()
|
||||
pass
|
||||
|
||||
func check_server():
|
||||
if slots[0].item:
|
||||
if slots[0].item.item_name == "Server":
|
||||
install_button.disabled = false
|
||||
else:
|
||||
install_button.disabled = true
|
||||
else:
|
||||
install_button.disabled = true
|
||||
|
||||
|
||||
|
||||
func _on_button_pressed() -> void:
|
||||
slots[0].item = null
|
||||
slots[0].update_ui()
|
||||
PlayerInventory.botnet_servers += 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue