1
Fork 0
mirror of https://github.com/Steffo99/nanogolf.git synced 2024-11-21 23:54:21 +00:00
algodist-steffo-nanogolf/scenes/players_list.gd

16 lines
463 B
GDScript

extends PanelContainer
class_name PlayersList
@onready var layout = $"Scrollable/Layout"
const player_label_scene = preload("res://scenes/player_label.tscn")
func _on_trackers_changed(trackers: Dictionary):
for child in layout.get_children():
child.queue_free()
for tracker in trackers.values():
var player_label_instance = player_label_scene.instantiate()
player_label_instance.update_from_tracker(tracker)
layout.add_child(player_label_instance)