if (!_appearanceSystem.TryGetData<bool>(uid, StackVisuals.Hide, out var hidden, args.Component))
hidden = false;
-
+
if (comp.IsComposite)
ProcessCompositeSprite(uid, actual, maxCount, comp.LayerStates, hidden, sprite: args.Sprite);
else
_appearance.SetData(uid, StorageVisuals.Capacity, capacity, appearance);
_appearance.SetData(uid, StorageVisuals.Open, isOpen, appearance);
_appearance.SetData(uid, SharedBagOpenVisuals.BagState, isOpen ? SharedBagState.Open : SharedBagState.Closed, appearance);
- _appearance.SetData(uid, StackVisuals.Hide, !isOpen, appearance);
+
+ // HideClosedStackVisuals true sets the StackVisuals.Hide to the open state of the storage.
+ // This is for containers that only show their contents when open. (e.g. donut boxes)
+ if (storage.HideStackVisualsWhenClosed)
+ _appearance.SetData(uid, StackVisuals.Hide, !isOpen, appearance);
}
/// <summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public StorageDefaultOrientation? DefaultStorageOrientation;
+ /// <summary>
+ /// If true, sets StackVisuals.Hide to true when the container is closed
+ /// Used in cases where there are sprites that are shown when the container is open but not
+ /// when it is closed
+ /// </summary>
+ [DataField]
+ public bool HideStackVisualsWhenClosed = true;
+
[Serializable, NetSerializable]
public enum StorageUiKey : byte
{