Making Drag Drop System for Items.
Drag Drop system is directly integrated in my UI system. So it can work with any UI elements in the game. Anything could potentially become draggable. This system allows you to have several draggable elements in you game, I filter drag operations based on string hash. To fulfill those requirements I've split Drag Drop system into 4 parts:
Drag Drop detection - this part happens in widget's update code. It intercepts mouse down event
Drag Drop start - this part is specific to the gameplay, for items I've done it in player Hud controller
Drag processing - this part lives inside UI manager, because it has top most mouse input handling order, so it can always finish drag drop when a player releases mouse button.
Drag Drop finish handling - this part is also specific to the gameplay, and it's also done in player Hud controller.
All drag drop data lives in drag drop memory arena, which is reset when drag drop starts.