SS3D icon indicating copy to clipboard operation
SS3D copied to clipboard

Stable inventory slot alignment

Open cosmiccoincidence opened this issue 1 year ago • 5 comments

Summary

Stabilize the inventory slot locations.

Current Behavior

Currently the inventory shifts (centers itself) based on size. This results in actual slots themselves shifting which would be annoying during gameplay. The best example of this is equiping/removing your jumpsuit.

Make the inventory UI slots not shift please.

  • The hands should be centered on the screen horizontally.
  • The belt, backpack, and ID slots should be to the left of the hands.
  • Pockets should appear to the right of the hands.

https://github.com/RE-SS3D/SS3D/assets/41941008/bdffd6c5-59fb-45aa-bf4d-fc0cf77af579

cosmiccoincidence avatar Nov 29 '23 22:11 cosmiccoincidence

Simple solution is to disable layout group component when remove slot, and enable when add slot.

Check HorizontalSlotOrder.Contains(container.Type) && layoutGroup.enabled in HandleInventoryContainerAdded and HandleInventoryContainerRemoved (InventoryView.cs)

Or add a parent, move the layout element component to the parent, and opreate (add/remove) in the child. 🤔

jckling avatar Dec 11 '23 08:12 jckling

Let's see what @stilnat says on that.

cosmiccoincidence avatar Dec 11 '23 21:12 cosmiccoincidence

Yeah I agree that this solution if this is just to make it work properly. In the future the ideal way is the UI tweening to the new position or another effect. Easier said than done though.

joaoburatto avatar Dec 12 '23 19:12 joaoburatto

@cosmiccoincidence we can also ease that transition with a hard alpha 0 and adding a fade in effect in the entire canvas group.

joaoburatto avatar Dec 12 '23 19:12 joaoburatto

@jckling @cosmiccoincidence to be honest, I've no idea if jckling solution will work, but if that does, I don't see any issues with it. Worth a try.

stilnat avatar Dec 13 '23 21:12 stilnat