4ian / GDevelop

🎮 Open-source, cross-platform 2D/3D/multiplayer game engine designed for everyone.
https://gdevelop.io
Other
10.75k stars 847 forks source link

Drag&Drop For Grouping Objects #4196

Open orbaysim opened 2 years ago

orbaysim commented 2 years ago

Hello,

I have mentioned this issue on discord before and Alex suggested me to open a Github issue.

If the development team can add the feature of dragging the objects from the objects list and dropping them to groups list for adding the object to a group, grouping would be much easier. There is a recording below to explain myself better:

https://user-images.githubusercontent.com/78256103/183881910-ece3e3ef-5c11-48e8-bbee-4124f8b556c1.mp4

AlexandreSi commented 2 years ago

Thanks for opening the issue!

Sumup of my investigation:

The issue is that the canDrop callback does not have context on the dragged object (that's to say the canMoveSelectionToItem given to SortableVirtualizedItemList by ObjectGroupsList would not be aware that the dragged item is either an object or an objects group). We would need to store the dragged object at the scene editor level.

Or we could change our drag and drop implementation so that the canDrop callback becomes aware of the dragged item(s).