Disable preview on the source grid

Jakuri

New member
Hi there,

I just mofified the demo storage menu to a shop. When the client drag item to the shop keeper's inventory the item will be sold.

But I just found when I drag a client's item to a shopkeeper's grid which already have an item on it, the preview on the source will be shown. Actually exchanging won't happen so it looks weird now.

Please make an option to disable this kind of preview, thanks!
 
Thank you for bringing this to my attention, here I implemented your feature request.

To recap this is the discussion I had with Jakuri in discord

Jakuri
Hi there, when I drag an item on another item, before drop, the item on the destination grid will appear on the source grid. What's the action called and how can I disable it?

Me
There are no options to disable just the preview on the source ItemViewSlot. It is built-in within the "DropHoverIconPreviewItemView" of the destination ItemView. The ItemViewDropHandler lets any ItemViewModule inheriting the "IItemViewSlotDropHoverSelectable" interface, that the ItemView is being hovered with another item. Inside the "SelectWith" function of the "DropHoverIconPreviewItemView" component I find the source ItemView and make it preview the item. I will add an option to disable that. Unfortunatly we just did the update so it won't be available for awhile. feel free to make a forum post about this issue and I'll share the code with you over there

Jakuri
Sure, thank you. I just mofified the demo storage menu to a shop. When the client drag item to the shop keeper's inventory the item will be sold.
But I just found when I drag a client's item to a shopkeeper's grid which already have an item on it, the preview on the source will be shown. Actually exchanging won't happen so it looks weird now.

Please find the new DropHoverIconPreviewItemView attached.
Note that as stated previously, the Destination ItemView with this component is the one that is triggering the preview to happen on the Source ItemView. I hope that helps
 

Attachments

  • DropHoverIconPreviewItemView.cs
    4.8 KB · Views: 2
Top