1
Fork 0
mirror of https://github.com/Steffo99/nanogolf.git synced 2024-11-24 17:14:19 +00:00
algodist-steffo-nanogolf/scenes/players_list.gd

17 lines
463 B
GDScript3
Raw Normal View History

2024-02-28 05:30:45 +00:00
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)