23 lines
503 B
GDScript
23 lines
503 B
GDScript
extends Window
|
|
class_name DragonList
|
|
|
|
@export var dragon_list_entry: PackedScene
|
|
@export var dragon_list_view: VBoxContainer
|
|
|
|
var _library: DragonLibrary
|
|
|
|
|
|
func set_library(library: DragonLibrary):
|
|
_library = library
|
|
for d in _library.dragons:
|
|
append_dragon(d)
|
|
|
|
|
|
func append_dragon(properties: DragonProperties):
|
|
var dragon: DragonListEntry = dragon_list_entry.instantiate()
|
|
dragon.set_properties(properties)
|
|
dragon_list_view.add_child(dragon)
|
|
|
|
|
|
func _on_close_requested() -> void:
|
|
queue_free()
|