41 lines
1.2 KiB
GDScript
41 lines
1.2 KiB
GDScript
extends Button
|
|
|
|
@onready var construct: Node3D = get_tree().get_first_node_in_group("Constructs")
|
|
|
|
var slot: int = 1
|
|
var con_name: String
|
|
|
|
func _process(_delta: float) -> void:
|
|
#print(self.toggle_mode)
|
|
##Show the construct which makes it pressable
|
|
##TODO make this aware of every possible construct
|
|
##Basically just visible is stick true right now
|
|
if construct != null:
|
|
if construct.constructs["stick"] == true:
|
|
self.visible = true
|
|
else:
|
|
self.visible = true
|
|
|
|
|
|
func _on_pressed() -> void:
|
|
pass
|
|
##TODO Make it so the player can select which slot to assign stick to
|
|
## Step 1: Have the button stay "selected" when pressed
|
|
## Step 2: If a button is selected when the player pressed 1 - 10
|
|
## assign stick to that slot
|
|
## Step 3: If the player presses the selected button again OR presses
|
|
## a new button THEN deselect that button
|
|
##Make sure the player can't assign it outside of 1 - 10
|
|
|
|
#match self.name:
|
|
#"StickButton":
|
|
#con_name = "stick"
|
|
#print(con_name)
|
|
#"WeightButton":
|
|
#con_name = "weight"
|
|
#print(con_name)
|
|
#if construct != null:
|
|
#construct.assigned_slot[1] = "weight"
|
|
#construct.set_construct(1, "weight")
|
|
|