Globalized variables, team member consistency
This commit is contained in:
@@ -5,6 +5,7 @@ signal texture_selected(texture : AtlasTexture)
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
|
||||
# Iterate over all children of the GridContainer
|
||||
for button in get_children():
|
||||
# Check if the child is a TextureButton
|
||||
@@ -12,14 +13,23 @@ func _ready():
|
||||
# Connect the pressed signal of the TextureButton to the handler function
|
||||
button.connect("pressed", Callable(self, "_on_TextureButton_pressed").bind(button))
|
||||
|
||||
|
||||
|
||||
# Handler function for the pressed signal
|
||||
func _on_TextureButton_pressed(button):
|
||||
# Print the name of the button
|
||||
print("Button pressed: ", button.name)
|
||||
#print("Button pressed: ", button.name)
|
||||
|
||||
#Texture Variable
|
||||
var texture : AtlasTexture = button.texture_normal
|
||||
#Sets the selected texture on the team screen
|
||||
Global.selected_texture = texture
|
||||
get_tree().change_scene_to_file("res://User Interface/UserInterface.tscn")
|
||||
|
||||
#For returning to the Team Selection Screen after selecting member
|
||||
#Sets the global variable for the team selection screen to true so when you move back it's already open
|
||||
Global.teamScreenVisible = true
|
||||
Global.teamSelectionVisible = false
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user