extends VBoxContainer onready var blocks = { "mane": $Mane, "entry": $Entry, "friend": $Friends, "resource": $Resources, "event": $Events, "troublemaker": $Troublemakers, "problem": $Problems } onready var labels = { "mane": $ManeLabel, "entry": $EntryLabel, "friend": $FriendsLabel, "resource": $ResourcesLabel, "event": $EventsLabel, "troublemaker": $TroublemakersLabel, "problem": $ProblemsLabel } var CardListItem := preload("res://Scenes/Shared/CardList/CardListItem.tscn") func add_card(cardID: String): # Get card data from ID var data := CardData.get_by_id(cardID) var item := CardListItem.instance() item.cardName = data.name item.cardSubname = data.subname item.showCost = has_cost(data.type) item.cardCost = data.cost item.color = to_color_ids(data.colors) blocks["entry"].add_child(item) var colorTable = { "Loyalty": "blue", "Generosity": "white", "Magic": "purple", "Laughter": "pink", "Kindness": "yellow", "Honesty": "orange" } func to_color_ids(ogcolors: Array) -> String: var newcol := [] for ogcol in ogcolors: if colorTable.has(ogcol): newcol.push_back(colorTable[ogcol]) match newcol.size(): 0: return "none" 1: return newcol[0] _: var multistr := "multi|" for col in newcol: multistr += col+"+" return multistr.trim_suffix("+") func has_cost(type: String) -> bool: match type: "Friend", "Resource", "Event": return true _: return false