diff --git a/src/logic-scenes/board/card-board.gd b/src/logic-scenes/board/card-board.gd index c4334d5..a0771b2 100644 --- a/src/logic-scenes/board/card-board.gd +++ b/src/logic-scenes/board/card-board.gd @@ -82,7 +82,7 @@ func handle_mouse_button(to_handle: Area2D, input: InputEvent): to_handle.set_owner(self) # needs to be here otherwise the owner disappears area_dict["post_its_in_list"].erase(to_handle) area_dict["dropzone_content"].push_back(to_handle) - # TODO: Add function to rearrange the array based on positions in the dropzone + # TODO (if needed): Add function to rearrange the array based on positions in the dropzone else: if is_in_dropzone(to_handle): if to_handle.has_overlapping_areas(): @@ -92,6 +92,9 @@ func handle_mouse_button(to_handle: Area2D, input: InputEvent): to_handle.reparent(area) to_handle.set_owner(self) to_handle.position = area.get_child(3).position + else: + to_handle.rotation = to_handle.base_rotation + to_handle.scale = to_handle.base_scale else: for panel in area_dict["post_it_panels"]: if panel.get_child_count() == 1: @@ -99,8 +102,10 @@ func handle_mouse_button(to_handle: Area2D, input: InputEvent): to_handle.set_owner(self) area_dict["dropzone_content"].erase(to_handle) area_dict["post_its_in_list"].push_back(to_handle) - # TODO: Add function to rearrange the array based on taken panel spot to_handle.position = panel.get_child(0).position + to_handle.rotation = to_handle.base_rotation + to_handle.scale = to_handle.base_scale + reorder_areas("post_its_in_list") break currently_dragged_area = null diff --git a/src/logic-scenes/board/post-it.gd b/src/logic-scenes/board/post-it.gd index c808d39..cd37efd 100644 --- a/src/logic-scenes/board/post-it.gd +++ b/src/logic-scenes/board/post-it.gd @@ -46,11 +46,15 @@ var modulate_tween @export var voice_line: AudioStream = null @export var is_dragable: bool = false +var base_rotation = null +var base_scale = null var is_dragged = false func _ready() -> void: self.set_meta("type", "post-it") # set type information to find out if this node is a post-it + base_rotation = rotation + base_scale = scale $Content/Label.text = self.text $Content/BackgroundSprite.frame = text.hash() % $Content/BackgroundSprite.sprite_frames.get_frame_count($Content/BackgroundSprite.animation)