peter-kish / gloot

A universal inventory system for the Godot game engine.
MIT License
625 stars 28 forks source link

Bug 2.4.6: items sometime overlap when item swapping. #191

Closed LeeWannacott closed 6 months ago

LeeWannacott commented 6 months ago

Hi,

Nice work on item swapping, I found some issues with it though.

Videos attached below (I suspect that the sword is one column wide while other stuff is 2 and also swapping ontop of two other items seems problematic):

https://github.com/peter-kish/gloot/assets/49783296/90d7e7dc-356d-40a7-8c80-f4655dc0ef78 https://github.com/peter-kish/gloot/assets/49783296/f50f7f47-a194-41c7-b905-f4ca9f7ac6cc https://github.com/peter-kish/gloot/assets/49783296/20f04bb2-04ef-4122-a6a1-59e1d5d7d51f https://github.com/peter-kish/gloot/assets/49783296/33a2b94a-ff0e-49eb-b5e0-6a6e66d1424b

Thanks.

peter-kish commented 6 months ago

Looks like I rushed the release a little bit... I'll try to come up with a fix soon.

peter-kish commented 6 months ago

Turned out it's quite difficult to do item swapping with items of different sizes. Often times more than just two items need to be moved around, or the items being swapped don't end up on the expected places.

For this reason I decided to limit the swapping feature to only items that have the same size. I'll keep this issue in mind and I'll hopefully come up with a solution for items of different sizes that is intuitive and also doesn't break anything.

LeeWannacott commented 6 months ago

Yeah, it is a complicated problem..

That sounds like a fine compromise to me (maybe people with more complicated games like backpack hero would want it, but most games aren't soley focused around managing inventory). Although, can you still allow switching between ItemSlots with items of different sizes (because that would be handy and shouldn't be problematic :crossed_fingers: ) ?

peter-kish commented 6 months ago

Sure, I think that's doable. I'll try to squeeze it into the next release.

peter-kish commented 6 months ago

Yeah, it is a complicated problem..

That sounds like a fine compromise to me (maybe people with more complicated games like backpack hero would want it, but most games aren't soley focused around managing inventory). Although, can you still allow switching between ItemSlots with items of different sizes (because that would be handy and shouldn't be problematic 🤞 ) ?

Should be implemented in v2.4.7.