fix sticky notes getting stuck underneath cards after they had been attached once.

This commit is contained in:
betalars 2025-04-30 16:34:00 +02:00
parent 591ba0978e
commit 4111b4efae
2 changed files with 7 additions and 0 deletions

View File

@ -221,6 +221,7 @@ func handle_mouse_button(input: InputEventMouseButton, to_handle = currently_act
to_handle.attached_to = sticky_note_container.get_child(current_sticky_note_id)
to_handle.reset_drag()
current_context = NAVIGATE
_return_sticky_notes_to_panels()
return
else:
area.attach_sticky_note(to_handle)
@ -265,6 +266,10 @@ func handle_mouse_button(input: InputEventMouseButton, to_handle = currently_act
func _return_sticky_notes_to_panels():
for panel:StickyNotePanel in sticky_note_container.get_children():
panel.reclaim_sticky_note()
for node in dropzone.get_children():
if node is StickyNote:
node.is_dragable = true
func is_board_complete() -> bool:
if mementos_collected == 4:
@ -314,6 +319,7 @@ func insert_area(parent: Control, node: Area2D):
if node is StickyNote:
node.attached_to = self
node.is_dragable = true
# Takes the inputs for control inputs
func _input(event):

View File

@ -217,6 +217,7 @@ func attach_sticky_note(sticky_note: StickyNote) -> bool:
sticky_note.reparent(self)
sticky_note.position = sticky_note_position
sticky_note.on_board = false
sticky_note.is_dragable = false
current_sticky_note = sticky_note
sticky_note.attached_to = self