SS3D
SS3D copied to clipboard
Non item support for containers
Summary
This PR aims to introduce non-item support for containers, for entities and substances.
Currently, containers can only hold items. Substances have their own container, which is not compatible with items or entities. Entities can't go into any container.
With this PR, entities can be put inside containers, and substances can go in any containers when allowed. A volume attribute has been defined to unify notion of place taken in a container for substances and items/Entities. Size is still there but should become deprecated as the UI for containers is going to change.
A IContainable interface has been defined. It was mostly defined to imitate the current behavior of items and allow anything implementing it to be put inside a container.
Pictures/Videos (optional)
The new tick box to choose if a container can hold substances or not.
Filling a toolbox with vodka, showing some rudimentary display of the substance inside the container.
Putting a poor Corgi inside a locker (bad boy).
Changes to Files
Many changes here, most of them to the interaction and container systems to account for the new interface Containable. Some changes on Entities as well to make them implement Containable. Many prefabs have been changed to account for the ability to contain non-item objects. Most changes in scripts are simply to replace Item with Containable.
Most important changes and additions are on
- Entity.cs (implementing IContainable)
- ContainerCustomDisplay.cs (ContainerItemDisplay before)
- ContainerDescriptor.cs (adding attributes to handle substances and volume)
- ContainerDescriptorEditor.cs (displaying new attributes correctly in the editor)
- IContainable.cs (the new interface)
- Item.cs (implementing IContainable)
- ColorChangeWhenFilled.cs, ItemDisplay.cs (to visualize a container being filled, proof of concept, should not stay in the long run)
- ContainerUi.cs to display in text the substances in the container
- SubstanceContainer.cs to account for volume being on ContainerDescriptor now.
Technical Notes (optional)
Fixes (optional)
This aims to close #653 and #683
This PR is linked to this design document. It doesn't intend to implement everything in it, only a part, and many part of the document are still up for discussion.
https://docs.google.com/document/d/1kwyGwPpShguMgqUJsdX2F2WIL3QiCEtK/edit
I cant remember but I thought this PR was waiting on something but I could be wrong. I see it was taken out of WIP and just need a review now. I know you've been gone lately but we'll figure this out.
I could not test this, couldn't find anything that would let me fill a container. Tried with the Vodka and the Toolbox.
Also there's an error in CanTransfer, "CanTranfer"
Closed due to staleness