wip implement #96: picking up sticky notes from the card board

This commit is contained in:
betalars 2025-05-08 21:53:53 +02:00
parent e18ae0e473
commit 8c3d7c7abb
1 changed files with 32 additions and 25 deletions

View File

@ -225,6 +225,7 @@ func handle_mouse_button(input: InputEventMouseButton, to_handle = currently_act
return
else:
area.attach_sticky_note(to_handle)
to_handle.z_index = 0
if sticky_note_container.get_child_count() > 0:
sticky_note_container.get_child(current_sticky_note_id).clear_if_empty()
current_context = NAVIGATE
@ -366,9 +367,8 @@ func _input(event):
current_context = NAVIGATE
elif event.is_action_pressed("ui_accept"): # select the selected note it
var card:Card
if dropzone.get_child(current_dropzone_id) is Card:
card = dropzone.get_child(current_dropzone_id)
var card:Card = dropzone.get_child(current_dropzone_id)
if current_context == ASSIGN: # to assign it to a card
if card.has_sticky_note_attached():
currently_active_node = card.exchange_sticky_note_with(currently_active_node)
@ -392,7 +392,14 @@ func _input(event):
current_sticky_note_id = current_sticky_note_id
else:
current_dropzone_id = current_dropzone_id
elif dropzone.get_child(current_dropzone_id) is StickyNote:
if currently_active_node is StickyNote:
currently_active_node = dropzone.get_child(current_dropzone_id)
focus_stickies = false
current_context = ASSIGN
current_dropzone_id += 1
currently_active_node.is_dragable = false
currently_active_node.z_index = 1
# move the note it so it floats next to the card where it should be attached
func _select_card_for_assigning(sticky_note: Area2D, card: Area2D):