4
0
Fork 0
WolfBox/scripts/role_card.gd

21 lines
449 B
GDScript

@tool
extends Card
@export var role: Role:
set(val):
if role != null:
role.disconnect("changed", update)
role = val
if role != null:
role.connect("changed", update)
update()
func _ready() -> void:
update()
func update() -> void:
if role == null:
return
$"RootMover/Card Front/VBoxContainer/RoleName".text = role.name
$"RootMover/Card Front/VBoxContainer/RoleDescription".text = "[center]" + role.description + "[/center]"