fix #105: removing incorrect null assignment and resolved warnings raised by empty typed array

This commit is contained in:
betalars 2025-03-05 19:41:22 +01:00
parent 1682e3edc2
commit edd2c57f20
2 changed files with 8 additions and 9 deletions

View File

@ -211,7 +211,6 @@ func remove_sticky_note() -> StickyNote:
current_sticky_note = null current_sticky_note = null
former_child.reparent(get_parent()) former_child.reparent(get_parent())
former_child.owner = self.owner former_child.owner = self.owner
former_child.current_handle = false
former_child.on_board = true former_child.on_board = true
former_child.attached_to = null former_child.attached_to = null
return former_child return former_child

View File

@ -12,7 +12,7 @@ var attached_to: Node = null:
set(new_attatchement): set(new_attatchement):
attached_to = new_attatchement attached_to = new_attatchement
# cannot be explicitly typed, as this can be bnoth handled by picker and physics-board # cannot be explicitly typed, as this can be bnoth handled by picker and physics-board
var current_handle var current_handle: Node
signal transform_tween_finished signal transform_tween_finished
@ -30,7 +30,6 @@ signal transform_tween_finished
set(highlight): set(highlight):
if highlight != highlighted: if highlight != highlighted:
highlighted = highlight highlighted = highlight
print("hightlight_set")
if is_inside_tree() and is_node_ready(): if is_inside_tree() and is_node_ready():
if modulate_tween: modulate_tween.kill() if modulate_tween: modulate_tween.kill()
@ -131,12 +130,13 @@ func _on_area_enter(card: Area2D):
attached_to.create_gap() attached_to.create_gap()
func _on_area_exit(card: Area2D): func _on_area_exit(card: Area2D):
if hovering_cards.has(card): if hovering_cards != []:
hovering_cards.erase(card) if card in hovering_cards:
card.highlighted = false hovering_cards.erase(card)
if hovering_cards == []: card.highlighted = false
hover_pos_shift = 0 if hovering_cards == []:
$Content.position = Vector2.ZERO hover_pos_shift = 0
$Content.position = Vector2.ZERO
elif card is StickyNote and is_sticky_note_in_panel(): elif card is StickyNote and is_sticky_note_in_panel():
attached_to.collapse_gap() attached_to.collapse_gap()