fix: card_board was unable to return a solid Array[Draggable]
This commit is contained in:
parent
6d72a09e1d
commit
06b06d8ada
|
|
@ -54,7 +54,7 @@ func _ready() -> void:
|
|||
|
||||
func set_line(line: StringName):
|
||||
subway.set_line(line)
|
||||
|
||||
|
||||
## One arrival and departure
|
||||
func cycle() -> void:
|
||||
await arrive()
|
||||
|
|
|
|||
|
|
@ -5,4 +5,4 @@ class_name Station
|
|||
@export var train_labels : Dictionary[StringName,String] = {}
|
||||
|
||||
func get_label(line: StringName, next_stop: Station) -> String:
|
||||
return train_labels.get(line+next_stop.name, line+next_stop.name)
|
||||
return train_labels.get(line+next_stop.name, line+next_stop.name)
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
|
|
@ -46,10 +46,10 @@ func start_room_async():
|
|||
|
||||
func play() -> String:
|
||||
for i in range(20): await get_tree().process_frame #HACK - can probably be removed
|
||||
|
||||
|
||||
await get_ready_async()
|
||||
await start_room_async()
|
||||
|
||||
|
||||
var next_room : StringName = await proceed
|
||||
prints("----------", "PROCEEDING", next_room, "--------------")
|
||||
return next_room
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -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 ===
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue