Boss fight rewards now update team inventory

This commit is contained in:
2024-06-12 08:48:21 -04:00
parent 4312c044d3
commit ee6fa21177
16 changed files with 534 additions and 228 deletions

View File

@@ -1,11 +1,13 @@
extends GridContainer
var target_buttons = [] # Array to hold target buttons
# Called when the node enters the scene tree for the first time.
func _ready():
load_character_buttons()
func _ready():
print("Team Selection loaded")
MemberDatabase.load_character_data()
load_character_buttons()
#pass
# Initialize or find the target buttons using their absolute paths
target_buttons = [
get_node("/root/Root/UI/AspectRatioContainer/TeamScreen/Member1"), # Replace with the actual path to your target button 1
@@ -16,10 +18,16 @@ func _ready():
]
func load_character_buttons():
#print("started load function")
#print(MemberDatabase.character_data)
if "members" in MemberDatabase.character_data:
#print("found members in data")
for character in MemberDatabase.character_data["members"]:
var button = create_character_button(character)
add_child(button)
#print("iterating through data")
if character["isObtained"] ==true:
print ("Created character:", character["name"])
var button = create_character_button(character)
add_child(button)
else:
print("No characters found in character data.")
@@ -87,6 +95,8 @@ func _on_button_pressed(button: TextureButton, member: Dictionary):
##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
get_tree().change_scene_to_file("res://team.tscn")