Hello,
I’ve been messing around with an inventory system. I can drag around an item, and the “on drop” event is recognized:
But there’s a catch: each item in the inventory is represented by a W_Slot that handles the drag operation.
It looks like this:
As you can see in the comment, I’d like to update the inventory as soon as the drag operation begins (and then set the item back if the drag is cancelled).
The issue is: it’s a common behavior to clear all the Widget items in an inventory and then to recreate them to “refresh” that same inventory.
But, by doing that, I actually delete the W_Slot that handles the drag operation, so the On Drag Cancelled event never fires (it took me a while to understand that).
Hence my question: what’s the best practise in that situation?
Thanks.