# W_Drag

File Location: Source\InventoryFrameworkPlugin\Public\Core\Widgets\W_Drag.h
File Location: Source\InventoryFrameworkPlugin\Private\Core\Widgets\W_Drag.cpp

File Location: Content\Core\Widgets\DragAndSplit\WBP_Drag.uasset


Visual representation of the item you are dragging, but also provides updates to W_Highlight whenever you hover over a tile so the highlight widget knows where to move.

All data you need when dragging and dropping an item should be stored in this widget.

Both W_Drag and W_Highlight are updated inside of WBP_Tile -> PerformDrop and BP_AC_Inventory -> UpdateHighlight

The chain of events begin at WBP_InventoryItem -> OnDragDetected. An important note to consider is that Epic, in their ever-ending glorious top tier coding, have a built in interpolation for the drag and drop drag visual that you CAN NOT interact with without modifying the engine.
But you have to go through a lot of trouble to replace the built-in drag and drop system for Unreal. So I leave the drag visual for the drag/drop operation as empty and allow WBP_Drag to drive the visuals and most of the logic. The Drag/Drop operation is primarily just used to trigger the "On Drop" events.

# Rotation

This widget is the primary handler of certain settings when trying to move an item, such as the rotation.
You can see an example on EventTick.
If you wish to permanently change the system to no longer support 180 and 270 rotation, there is a code comment near the end of EventTick explaining how to enforce only 0 and 90 rotation.