fix: card_board was unable to return a solid Array[Draggable]

This commit is contained in:
tiger tiger tiger 2026-05-06 15:40:50 +02:00
parent 6d72a09e1d
commit 06b06d8ada
8 changed files with 14 additions and 8 deletions

View File

@ -19,4 +19,3 @@ func set_line(line : StringName):
$TrainModel/traun_hull.material_overlay = materials[line]
$TrainModel/LineLabelBack.text = line.to_upper()
$TrainModel/LineLabelFront.text = line.to_upper()

View File

@ -545,15 +545,22 @@ var dropzone_size: Vector2:
var _selection_candidates : Array[Draggable]:
get:
match selection_state:
SelectionState.CARDS: return cards as Array[Draggable]
SelectionState.STICKIES: return notes as Array[Draggable]
SelectionState.CARDS:
return as_draggable(cards)
SelectionState.STICKIES:
return as_draggable(notes)
SelectionState.FREE:
print("switching from free selection to guided stickies selection")
# Otherwise default to sticky selection
selection_state = SelectionState.STICKIES
return notes as Array[Draggable]
return as_draggable(notes)
func as_draggable(items : Array) -> Array[Draggable]:
var result : Array[Draggable] = []
for item in items:
result.append(item)
return result
# === Util ===