Moving shape items between the equipment slot and the inventory.

Sinplay

New member
Hello, I encountered an issue while using the shape grid. For design purposes, this item was designed with this shape.
1711974508996.png
It can move correctly in the inventory
1711974514358.png
but when I move it from the equipment slot to the inventory, the shape of the item cannot be recognized correctly. I hope to resolve it.

1711974528591.png
 
Rather than the shape not being recognized properly, I think there is something preventing you from moving the item from the equipment to the Inventory Grid.
This is handled by the drag and drop conditions and actions. Learn more here:

My guess is that the condition is failing that's why it's red when you try to drop it from the equipment.
There are multiple reasons the condition would fail. Perhaps it thinks the item is already part of the Inventory and can't add it again, perhaps something else.
Let me know what drag&drop condition you are using and if possible try to step through the code as you hover to see what part of the code returns false

If you need more guidance please let me know :)
 
Apart from the anchor point position, I'm using mostly default settings, and there are no errors or warning prompts during item movement. This seems to be a misalignment caused by changing the anchor point. I'm not sure if others have encountered this issue (as it seems quite easy to trigger). If others haven't experienced it, there might be an issue with my settings?2024-04-01 22-03-27 00_00_00-00_00_30~2.gif
 
Yeah you are right that looks like a bug. I will try to replicate this shape and see if I can get the same issue on my machine
 
Thank you for reporting this bug. I was able to find the root of the issue
Note that this fix will come in the next update. But if you want to fix it yourself here are the scripts I changed:

1)
ItemShapeGridUtility.cs script completely rewritten, script attached.

2)
ItemViewShapeDropAction.cs
Replace "GetDestinationAnchorIndex" by "GetDestinationIndex" in both CanDrop and Drop functions (line 37 and line 64)

3)
ItemShapeSelectedItemView.cs
Add "position -= itemShape.Achor;" on line 107


I've tested anchors in both X and Y in different drops:
  • Same item shape Grids
  • Between seperate Item Shape Grids
  • From equipment container to ItemShapeGrid

And that should solve the anchor issues you had
If you still see some issues please let me know :)
 

Attachments

  • ItemShapeGridUtility.cs
    5.5 KB · Views: 1
Top