Cigarette ecs (#4495)
* Reorganized Shared.Storage folder * Replace StorageCounter with Item Counter * Change stack visuals setting data * Fix mirrorcult suggestions * Fix items from upstream * Fix type formatting
This commit is contained in:
@@ -177,7 +177,6 @@ namespace Content.Client.Entry
|
|||||||
"Firelock",
|
"Firelock",
|
||||||
"AtmosPlaque",
|
"AtmosPlaque",
|
||||||
"Spillable",
|
"Spillable",
|
||||||
"StorageCounter",
|
|
||||||
"SpaceVillainArcade",
|
"SpaceVillainArcade",
|
||||||
"Flammable",
|
"Flammable",
|
||||||
"Smoking",
|
"Smoking",
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Client.Animations;
|
using Content.Client.Animations;
|
||||||
using Content.Client.Items.Components;
|
|
||||||
using Content.Client.Hands;
|
using Content.Client.Hands;
|
||||||
|
using Content.Client.Items.Components;
|
||||||
using Content.Client.UserInterface.Controls;
|
using Content.Client.UserInterface.Controls;
|
||||||
using Content.Shared.DragDrop;
|
using Content.Shared.DragDrop;
|
||||||
|
using Content.Shared.Stacks;
|
||||||
using Content.Shared.Storage;
|
using Content.Shared.Storage;
|
||||||
|
using Content.Shared.Storage.Components;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Client.Graphics;
|
using Robust.Client.Graphics;
|
||||||
using Robust.Client.Player;
|
using Robust.Client.Player;
|
||||||
@@ -33,7 +35,6 @@ namespace Content.Client.Storage
|
|||||||
private int StorageSizeUsed;
|
private int StorageSizeUsed;
|
||||||
private int StorageCapacityMax;
|
private int StorageCapacityMax;
|
||||||
private StorageWindow? _window;
|
private StorageWindow? _window;
|
||||||
private SharedBagState _bagState;
|
|
||||||
|
|
||||||
public override IReadOnlyList<IEntity> StoredEntities => _storedEntities;
|
public override IReadOnlyList<IEntity> StoredEntities => _storedEntities;
|
||||||
|
|
||||||
@@ -83,15 +84,12 @@ namespace Content.Client.Storage
|
|||||||
//Updates what we are storing for the UI
|
//Updates what we are storing for the UI
|
||||||
case StorageHeldItemsMessage msg:
|
case StorageHeldItemsMessage msg:
|
||||||
HandleStorageMessage(msg);
|
HandleStorageMessage(msg);
|
||||||
ChangeStorageVisualization(_bagState);
|
|
||||||
break;
|
break;
|
||||||
//Opens the UI
|
//Opens the UI
|
||||||
case OpenStorageUIMessage _:
|
case OpenStorageUIMessage _:
|
||||||
ChangeStorageVisualization(SharedBagState.Open);
|
|
||||||
ToggleUI();
|
ToggleUI();
|
||||||
break;
|
break;
|
||||||
case CloseStorageUIMessage _:
|
case CloseStorageUIMessage _:
|
||||||
ChangeStorageVisualization(SharedBagState.Close);
|
|
||||||
CloseUI();
|
CloseUI();
|
||||||
break;
|
break;
|
||||||
case AnimateInsertingEntitiesMessage msg:
|
case AnimateInsertingEntitiesMessage msg:
|
||||||
@@ -138,22 +136,36 @@ namespace Content.Client.Storage
|
|||||||
if (_window == null) return;
|
if (_window == null) return;
|
||||||
|
|
||||||
if (_window.IsOpen)
|
if (_window.IsOpen)
|
||||||
|
{
|
||||||
_window.Close();
|
_window.Close();
|
||||||
|
ChangeStorageVisualization(SharedBagState.Close);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
_window.OpenCentered();
|
_window.OpenCentered();
|
||||||
|
ChangeStorageVisualization(SharedBagState.Open);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CloseUI()
|
private void CloseUI()
|
||||||
{
|
{
|
||||||
_window?.Close();
|
if (_window == null) return;
|
||||||
|
|
||||||
|
_window.Close();
|
||||||
|
ChangeStorageVisualization(SharedBagState.Close);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ChangeStorageVisualization(SharedBagState state)
|
private void ChangeStorageVisualization(SharedBagState state)
|
||||||
{
|
{
|
||||||
_bagState = state;
|
|
||||||
if (Owner.TryGetComponent<AppearanceComponent>(out var appearanceComponent))
|
if (Owner.TryGetComponent<AppearanceComponent>(out var appearanceComponent))
|
||||||
{
|
{
|
||||||
appearanceComponent.SetData(SharedBagOpenVisuals.BagState, state);
|
appearanceComponent.SetData(SharedBagOpenVisuals.BagState, state);
|
||||||
|
if (Owner.HasComponent<ItemCounterComponent>())
|
||||||
|
{
|
||||||
|
appearanceComponent.SetData(StackVisuals.Hide, state == SharedBagState.Close);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
using Content.Shared.Stacks;
|
using Content.Shared.Stacks;
|
||||||
using Content.Shared.Storage;
|
using Content.Shared.Storage;
|
||||||
|
using Content.Shared.Storage.Components;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
@@ -57,7 +58,7 @@ namespace Content.Client.Storage.Visualizers
|
|||||||
spriteComponent.LayerSetVisible(OpenIcon, false);
|
spriteComponent.LayerSetVisible(OpenIcon, false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
component.SetData(StackVisuals.Hide, bagState == SharedBagState.Close);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Shared.Storage.ItemCounter;
|
using Content.Shared.Storage.Components;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
@@ -36,7 +36,7 @@ namespace Content.Client.Storage.Visualizers
|
|||||||
InitLayers(spriteComponent, component);
|
InitLayers(spriteComponent, component);
|
||||||
}
|
}
|
||||||
EnableLayers(spriteComponent, component);
|
EnableLayers(spriteComponent, component);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,82 +0,0 @@
|
|||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Content.Shared.Stacks;
|
|
||||||
using Content.Shared.Tag;
|
|
||||||
using Robust.Server.GameObjects;
|
|
||||||
using Robust.Shared.Containers;
|
|
||||||
using Robust.Shared.GameObjects;
|
|
||||||
using Robust.Shared.Log;
|
|
||||||
using Robust.Shared.Serialization;
|
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
|
||||||
|
|
||||||
namespace Content.Server.Storage.Components
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Storage that spawns and counts a single item.
|
|
||||||
/// Usually used for things like matchboxes, cigarette packs,
|
|
||||||
/// cigar cases etc.
|
|
||||||
/// </summary>
|
|
||||||
/// <code>
|
|
||||||
/// - type: StorageCounter
|
|
||||||
/// amount: 6 # Note: this field can be omitted
|
|
||||||
/// countTag: Cigarette # Note: field doesn't point to entity Id, but its tag
|
|
||||||
/// </code>
|
|
||||||
[Obsolete("Should be deprecated in favor of SharedItemCounterSystem")]
|
|
||||||
[RegisterComponent]
|
|
||||||
public class StorageCounterComponent : Component, ISerializationHooks
|
|
||||||
{
|
|
||||||
// TODO Convert to EntityWhitelist
|
|
||||||
[DataField("countTag")]
|
|
||||||
private string? _countTag;
|
|
||||||
|
|
||||||
[DataField("amount")]
|
|
||||||
private int? _maxAmount;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Single item storage component usually have an attached StackedVisualizer.
|
|
||||||
/// </summary>
|
|
||||||
[ComponentDependency] private readonly AppearanceComponent? _appearanceComponent = default;
|
|
||||||
|
|
||||||
public override string Name => "StorageCounter";
|
|
||||||
|
|
||||||
void ISerializationHooks.AfterDeserialization()
|
|
||||||
{
|
|
||||||
if (_countTag == null)
|
|
||||||
{
|
|
||||||
Logger.Warning("StorageCounterComponent without a `countTag` is useless");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ContainerUpdateAppearance(IContainer container)
|
|
||||||
{
|
|
||||||
if(_appearanceComponent is null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
var actual = Count(container.ContainedEntities);
|
|
||||||
_appearanceComponent.SetData(StackVisuals.Actual, actual);
|
|
||||||
|
|
||||||
if (_maxAmount != null)
|
|
||||||
{
|
|
||||||
_appearanceComponent.SetData(StackVisuals.MaxCount, _maxAmount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private int Count(IReadOnlyList<IEntity> containerContainedEntities)
|
|
||||||
{
|
|
||||||
var count = 0;
|
|
||||||
if (_countTag != null)
|
|
||||||
{
|
|
||||||
foreach (var entity in containerContainedEntities)
|
|
||||||
{
|
|
||||||
if (entity.HasTag(_countTag))
|
|
||||||
{
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return count;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,41 +1,29 @@
|
|||||||
using System.Collections.Generic;
|
using Content.Server.Storage.Components;
|
||||||
using Content.Server.Storage.Components;
|
using Content.Shared.Storage.Components;
|
||||||
using Content.Shared.Storage.ItemCounter;
|
using Content.Shared.Storage.EntitySystems;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.GameObjects;
|
|
||||||
|
|
||||||
namespace Content.Server.Storage.EntitySystems
|
namespace Content.Server.Storage.EntitySystems
|
||||||
{
|
{
|
||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public class ItemCounterSystem : SharedItemCounterSystem
|
public class ItemCounterSystem : SharedItemCounterSystem
|
||||||
{
|
{
|
||||||
protected override bool TryGetContainer(ContainerModifiedMessage msg,
|
protected override int? GetCount(ContainerModifiedMessage msg, ItemCounterComponent itemCounter)
|
||||||
ItemCounterComponent itemCounter,
|
|
||||||
out IReadOnlyList<string> showLayers)
|
|
||||||
{
|
{
|
||||||
if (msg.Container.Owner.TryGetComponent(out ServerStorageComponent? component))
|
if (!msg.Container.Owner.TryGetComponent(out ServerStorageComponent? component)
|
||||||
|
|| component.StoredEntities == null)
|
||||||
{
|
{
|
||||||
var containedLayers = component.StoredEntities ?? new List<IEntity>();
|
return null;
|
||||||
var list = new List<string>();
|
|
||||||
foreach (var mapLayerData in itemCounter.MapLayers.Values)
|
|
||||||
{
|
|
||||||
foreach (var entity in containedLayers)
|
|
||||||
{
|
|
||||||
if (mapLayerData.Whitelist.IsValid(entity))
|
|
||||||
{
|
|
||||||
list.Add(mapLayerData.Layer);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
showLayers = list;
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
showLayers = new List<string>();
|
var count = 0;
|
||||||
return false;
|
foreach (var entity in component.StoredEntities)
|
||||||
|
{
|
||||||
|
if (itemCounter.Count.IsValid(entity)) count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
43
Content.Server/Storage/EntitySystems/ItemMapperSystem.cs
Normal file
43
Content.Server/Storage/EntitySystems/ItemMapperSystem.cs
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Content.Server.Storage.Components;
|
||||||
|
using Content.Shared.Storage.Components;
|
||||||
|
using Content.Shared.Storage.EntitySystems;
|
||||||
|
using JetBrains.Annotations;
|
||||||
|
using Robust.Shared.Analyzers;
|
||||||
|
using Robust.Shared.Containers;
|
||||||
|
using Robust.Shared.GameObjects;
|
||||||
|
|
||||||
|
namespace Content.Server.Storage.EntitySystems
|
||||||
|
{
|
||||||
|
[UsedImplicitly]
|
||||||
|
public class ItemMapperSystem : SharedItemMapperSystem
|
||||||
|
{
|
||||||
|
protected override bool TryGetLayers(ContainerModifiedMessage msg,
|
||||||
|
ItemMapperComponent itemMapper,
|
||||||
|
out IReadOnlyList<string> showLayers)
|
||||||
|
{
|
||||||
|
if (msg.Container.Owner.TryGetComponent(out ServerStorageComponent? component))
|
||||||
|
{
|
||||||
|
var containedLayers = component.StoredEntities ?? new List<IEntity>();
|
||||||
|
var list = new List<string>();
|
||||||
|
foreach (var mapLayerData in itemMapper.MapLayers.Values)
|
||||||
|
{
|
||||||
|
foreach (var entity in containedLayers)
|
||||||
|
{
|
||||||
|
if (mapLayerData.Whitelist.IsValid(entity))
|
||||||
|
{
|
||||||
|
list.Add(mapLayerData.Layer);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
showLayers = list;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
showLayers = new List<string>();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -39,11 +39,6 @@ namespace Content.Server.Storage.EntitySystems
|
|||||||
{
|
{
|
||||||
storageComp.HandleEntityMaybeRemoved(message);
|
storageComp.HandleEntityMaybeRemoved(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oldParentEntity.TryGetComponent<StorageCounterComponent>(out var newStorageComp))
|
|
||||||
{
|
|
||||||
newStorageComp.ContainerUpdateAppearance(message.Container);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void HandleEntityInsertedIntoContainer(EntInsertedIntoContainerMessage message)
|
private static void HandleEntityInsertedIntoContainer(EntInsertedIntoContainerMessage message)
|
||||||
@@ -54,11 +49,6 @@ namespace Content.Server.Storage.EntitySystems
|
|||||||
{
|
{
|
||||||
storageComp.HandleEntityMaybeInserted(message);
|
storageComp.HandleEntityMaybeInserted(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oldParentEntity.TryGetComponent<StorageCounterComponent>(out var newStorageComp))
|
|
||||||
{
|
|
||||||
newStorageComp.ContainerUpdateAppearance(message.Container);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckSubscribedEntities(ServerStorageComponent storageComp)
|
private void CheckSubscribedEntities(ServerStorageComponent storageComp)
|
||||||
|
|||||||
33
Content.Shared/Storage/Components/ItemCounterComponent.cs
Normal file
33
Content.Shared/Storage/Components/ItemCounterComponent.cs
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
using Content.Shared.Storage.EntitySystems;
|
||||||
|
using Content.Shared.Whitelist;
|
||||||
|
using Robust.Shared.Analyzers;
|
||||||
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
|
|
||||||
|
namespace Content.Shared.Storage.Components
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Storage that spawns and counts a single item.
|
||||||
|
/// Usually used for things like matchboxes, cigarette packs,
|
||||||
|
/// cigar cases etc.
|
||||||
|
/// </summary>
|
||||||
|
/// <code>
|
||||||
|
/// - type: ItemCounter
|
||||||
|
/// amount: 6 # Note: this field can be omitted.
|
||||||
|
/// count:
|
||||||
|
/// tags: [Cigarette]
|
||||||
|
/// </code>
|
||||||
|
[RegisterComponent]
|
||||||
|
[Friend(typeof(SharedItemCounterSystem))]
|
||||||
|
public class ItemCounterComponent : Component
|
||||||
|
{
|
||||||
|
public override string Name => "ItemCounter";
|
||||||
|
|
||||||
|
[DataField("count", required: true)]
|
||||||
|
public EntityWhitelist Count { get; set; } = default!;
|
||||||
|
|
||||||
|
[DataField("amount")]
|
||||||
|
public int? MaxAmount { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,14 +1,17 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Content.Shared.Storage.EntitySystems;
|
||||||
|
using Robust.Shared.Analyzers;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
|
|
||||||
namespace Content.Shared.Storage.ItemCounter
|
namespace Content.Shared.Storage.Components
|
||||||
{
|
{
|
||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public class ItemCounterComponent : Component, ISerializationHooks
|
[Friend(typeof(SharedItemMapperSystem))]
|
||||||
|
public class ItemMapperComponent : Component, ISerializationHooks
|
||||||
{
|
{
|
||||||
public override string Name => "ItemCounter";
|
public override string Name => "ItemMapper";
|
||||||
|
|
||||||
[DataField("mapLayers")] public readonly Dictionary<string, SharedMapLayerData> MapLayers = new();
|
[DataField("mapLayers")] public readonly Dictionary<string, SharedMapLayerData> MapLayers = new();
|
||||||
|
|
||||||
@@ -21,4 +24,4 @@ namespace Content.Shared.Storage.ItemCounter
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
|
|
||||||
namespace Content.Shared.Storage
|
namespace Content.Shared.Storage.Components
|
||||||
{
|
{
|
||||||
[Serializable, NetSerializable]
|
[Serializable, NetSerializable]
|
||||||
public enum SharedBagOpenVisuals : byte
|
public enum SharedBagOpenVisuals : byte
|
||||||
@@ -4,7 +4,7 @@ using Content.Shared.Whitelist;
|
|||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
|
|
||||||
namespace Content.Shared.Storage.ItemCounter
|
namespace Content.Shared.Storage.Components
|
||||||
{
|
{
|
||||||
[Serializable, NetSerializable]
|
[Serializable, NetSerializable]
|
||||||
public enum StorageMapVisuals : sbyte
|
public enum StorageMapVisuals : sbyte
|
||||||
@@ -43,4 +43,4 @@ namespace Content.Shared.Storage.ItemCounter
|
|||||||
QueuedEntities = other.QueuedEntities;
|
QueuedEntities = other.QueuedEntities;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
using Content.Shared.Stacks;
|
||||||
|
using Content.Shared.Storage.Components;
|
||||||
|
using JetBrains.Annotations;
|
||||||
|
using Robust.Shared.Containers;
|
||||||
|
using Robust.Shared.GameObjects;
|
||||||
|
|
||||||
|
namespace Content.Shared.Storage.EntitySystems
|
||||||
|
{
|
||||||
|
[UsedImplicitly]
|
||||||
|
public abstract class SharedItemCounterSystem : EntitySystem
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
SubscribeLocalEvent<ItemCounterComponent, EntInsertedIntoContainerMessage>(CounterEntityInserted);
|
||||||
|
SubscribeLocalEvent<ItemCounterComponent, EntRemovedFromContainerMessage>(CounterEntityRemoved);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CounterEntityInserted(EntityUid uid, ItemCounterComponent itemCounter,
|
||||||
|
EntInsertedIntoContainerMessage args)
|
||||||
|
{
|
||||||
|
if (!itemCounter.Owner.TryGetComponent(out SharedAppearanceComponent? appearanceComponent)) return;
|
||||||
|
|
||||||
|
var count = GetCount(args, itemCounter);
|
||||||
|
if (count == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
appearanceComponent.SetData(StackVisuals.Actual, count);
|
||||||
|
if (itemCounter.MaxAmount != null)
|
||||||
|
appearanceComponent.SetData(StackVisuals.MaxCount, itemCounter.MaxAmount);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CounterEntityRemoved(EntityUid uid, ItemCounterComponent itemCounter,
|
||||||
|
EntRemovedFromContainerMessage args)
|
||||||
|
{
|
||||||
|
if (!itemCounter.Owner.TryGetComponent(out SharedAppearanceComponent? appearanceComponent)) return;
|
||||||
|
|
||||||
|
var count = GetCount(args, itemCounter);
|
||||||
|
if (count == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
appearanceComponent.SetData(StackVisuals.Actual, count);
|
||||||
|
if (itemCounter.MaxAmount != null)
|
||||||
|
appearanceComponent.SetData(StackVisuals.MaxCount, itemCounter.MaxAmount);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract int? GetCount(ContainerModifiedMessage msg, ItemCounterComponent itemCounter);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Content.Shared.Storage.Components;
|
||||||
|
using JetBrains.Annotations;
|
||||||
|
using Robust.Shared.Containers;
|
||||||
|
using Robust.Shared.GameObjects;
|
||||||
|
|
||||||
|
namespace Content.Shared.Storage.EntitySystems
|
||||||
|
{
|
||||||
|
[UsedImplicitly]
|
||||||
|
public abstract class SharedItemMapperSystem : EntitySystem
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
SubscribeLocalEvent<ItemMapperComponent, ComponentInit>(InitLayers);
|
||||||
|
SubscribeLocalEvent<ItemMapperComponent, EntInsertedIntoContainerMessage>(MapperEntityInserted);
|
||||||
|
SubscribeLocalEvent<ItemMapperComponent, EntRemovedFromContainerMessage>(MapperEntityRemoved);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitLayers(EntityUid uid, ItemMapperComponent component, ComponentInit args)
|
||||||
|
{
|
||||||
|
if (component.Owner.TryGetComponent(out SharedAppearanceComponent? appearanceComponent))
|
||||||
|
{
|
||||||
|
var list = new List<string>(component.MapLayers.Keys);
|
||||||
|
appearanceComponent.SetData(StorageMapVisuals.InitLayers, new ShowLayerData(list));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MapperEntityRemoved(EntityUid uid, ItemMapperComponent itemMapper,
|
||||||
|
EntRemovedFromContainerMessage args)
|
||||||
|
{
|
||||||
|
if (itemMapper.Owner.TryGetComponent(out SharedAppearanceComponent? appearanceComponent)
|
||||||
|
&& TryGetLayers(args, itemMapper, out var containedLayers))
|
||||||
|
{
|
||||||
|
appearanceComponent.SetData(StorageMapVisuals.LayerChanged, new ShowLayerData(containedLayers));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MapperEntityInserted(EntityUid uid, ItemMapperComponent itemMapper,
|
||||||
|
EntInsertedIntoContainerMessage args)
|
||||||
|
{
|
||||||
|
if (itemMapper.Owner.TryGetComponent(out SharedAppearanceComponent? appearanceComponent)
|
||||||
|
&& TryGetLayers(args, itemMapper, out var containedLayers))
|
||||||
|
{
|
||||||
|
appearanceComponent.SetData(StorageMapVisuals.LayerChanged, new ShowLayerData(containedLayers));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract bool TryGetLayers(ContainerModifiedMessage msg,
|
||||||
|
ItemMapperComponent itemMapper,
|
||||||
|
out IReadOnlyList<string> containedLayers);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using JetBrains.Annotations;
|
|
||||||
using Robust.Shared.Containers;
|
|
||||||
using Robust.Shared.GameObjects;
|
|
||||||
|
|
||||||
namespace Content.Shared.Storage.ItemCounter
|
|
||||||
{
|
|
||||||
[UsedImplicitly]
|
|
||||||
public abstract class SharedItemCounterSystem : EntitySystem
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public override void Initialize()
|
|
||||||
{
|
|
||||||
base.Initialize();
|
|
||||||
SubscribeLocalEvent<ItemCounterComponent, ComponentInit>(InitLayers);
|
|
||||||
SubscribeLocalEvent<ItemCounterComponent, EntInsertedIntoContainerMessage>(HandleEntityInsert);
|
|
||||||
SubscribeLocalEvent<ItemCounterComponent, EntRemovedFromContainerMessage>(HandleEntityRemoved);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void InitLayers(EntityUid uid, ItemCounterComponent component, ComponentInit args)
|
|
||||||
{
|
|
||||||
if (component.Owner.TryGetComponent(out SharedAppearanceComponent? appearanceComponent))
|
|
||||||
{
|
|
||||||
var list = new List<string>(component.MapLayers.Keys);
|
|
||||||
appearanceComponent.SetData(StorageMapVisuals.InitLayers, new ShowLayerData(list));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void HandleEntityRemoved(EntityUid uid, ItemCounterComponent itemCounter,
|
|
||||||
EntRemovedFromContainerMessage args)
|
|
||||||
{
|
|
||||||
if (itemCounter.Owner.TryGetComponent(out SharedAppearanceComponent? appearanceComponent)
|
|
||||||
&& TryGetContainer(args, itemCounter, out var containedLayers))
|
|
||||||
{
|
|
||||||
appearanceComponent.SetData(StorageMapVisuals.LayerChanged, new ShowLayerData(containedLayers));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void HandleEntityInsert(EntityUid uid, ItemCounterComponent itemCounter,
|
|
||||||
EntInsertedIntoContainerMessage args)
|
|
||||||
{
|
|
||||||
if (itemCounter.Owner.TryGetComponent(out SharedAppearanceComponent? appearanceComponent)
|
|
||||||
&& TryGetContainer(args, itemCounter, out var containedLayers))
|
|
||||||
{
|
|
||||||
appearanceComponent.SetData(StorageMapVisuals.LayerChanged, new ShowLayerData(containedLayers));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract bool TryGetContainer(ContainerModifiedMessage msg,
|
|
||||||
ItemCounterComponent itemCounter,
|
|
||||||
out IReadOnlyList<string> containedLayers);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
- Welder
|
- Welder
|
||||||
- Radio
|
- Radio
|
||||||
- PowerCell
|
- PowerCell
|
||||||
- type: ItemCounter
|
- type: ItemMapper
|
||||||
mapLayers:
|
mapLayers:
|
||||||
cutters_red:
|
cutters_red:
|
||||||
whitelist:
|
whitelist:
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
- Radio
|
- Radio
|
||||||
- Handcuff
|
- Handcuff
|
||||||
- PowerCell
|
- PowerCell
|
||||||
- type: ItemCounter
|
- type: ItemMapper
|
||||||
mapLayers:
|
mapLayers:
|
||||||
drill:
|
drill:
|
||||||
whitelist:
|
whitelist:
|
||||||
@@ -161,7 +161,7 @@
|
|||||||
- Handcuff
|
- Handcuff
|
||||||
- RangedMagazine
|
- RangedMagazine
|
||||||
- Ammo
|
- Ammo
|
||||||
- type: ItemCounter
|
- type: ItemMapper
|
||||||
mapLayers:
|
mapLayers:
|
||||||
flashbang:
|
flashbang:
|
||||||
whitelist:
|
whitelist:
|
||||||
@@ -196,7 +196,7 @@
|
|||||||
- Soap
|
- Soap
|
||||||
- Flashlight
|
- Flashlight
|
||||||
- CigPack
|
- CigPack
|
||||||
- type: ItemCounter
|
- type: ItemMapper
|
||||||
mapLayers:
|
mapLayers:
|
||||||
bottle:
|
bottle:
|
||||||
whitelist:
|
whitelist:
|
||||||
@@ -241,7 +241,7 @@
|
|||||||
- Hypospray
|
- Hypospray
|
||||||
- SurgeryTool
|
- SurgeryTool
|
||||||
- Radio
|
- Radio
|
||||||
- type: ItemCounter
|
- type: ItemMapper
|
||||||
mapLayers:
|
mapLayers:
|
||||||
bottle:
|
bottle:
|
||||||
whitelist:
|
whitelist:
|
||||||
@@ -300,7 +300,7 @@
|
|||||||
components:
|
components:
|
||||||
- Seed
|
- Seed
|
||||||
- Smoking
|
- Smoking
|
||||||
- type: ItemCounter
|
- type: ItemMapper
|
||||||
mapLayers:
|
mapLayers:
|
||||||
hatchet:
|
hatchet:
|
||||||
whitelist:
|
whitelist:
|
||||||
@@ -352,7 +352,7 @@
|
|||||||
- FlashOnTrigger
|
- FlashOnTrigger
|
||||||
- Flash
|
- Flash
|
||||||
- Handcuff
|
- Handcuff
|
||||||
- type: ItemCounter
|
- type: ItemMapper
|
||||||
mapLayers:
|
mapLayers:
|
||||||
flashbang:
|
flashbang:
|
||||||
whitelist:
|
whitelist:
|
||||||
@@ -396,7 +396,7 @@
|
|||||||
- type: StorageFill
|
- type: StorageFill
|
||||||
contents:
|
contents:
|
||||||
- id: CaptainSabre
|
- id: CaptainSabre
|
||||||
- type: ItemCounter
|
- type: ItemMapper
|
||||||
mapLayers:
|
mapLayers:
|
||||||
sheath-bag:
|
sheath-bag:
|
||||||
whitelist:
|
whitelist:
|
||||||
|
|||||||
@@ -26,25 +26,26 @@
|
|||||||
HeldPrefix: box
|
HeldPrefix: box
|
||||||
- type: StorageFill
|
- type: StorageFill
|
||||||
contents:
|
contents:
|
||||||
- id: FoodDonutPink
|
- id: FoodDonutPink
|
||||||
amount: 3
|
amount: 3
|
||||||
- id: FoodDonutPlain
|
- id: FoodDonutPlain
|
||||||
amount: 3
|
amount: 3
|
||||||
- type: StorageCounter
|
- type: ItemCounter
|
||||||
countTag: Donut
|
count:
|
||||||
|
tags: [Donut]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: BagOpenCloseVisualizer
|
- type: BagOpenCloseVisualizer
|
||||||
openIcon: box-open
|
openIcon: box-open
|
||||||
- type: StackVisualizer
|
- type: StackVisualizer
|
||||||
composite: true
|
composite: true
|
||||||
stackLayers:
|
stackLayers:
|
||||||
- box1
|
- box1
|
||||||
- pink-box2
|
- pink-box2
|
||||||
- box3
|
- box3
|
||||||
- pink-box4
|
- pink-box4
|
||||||
- box5
|
- box5
|
||||||
- pink-box6
|
- pink-box6
|
||||||
|
|
||||||
# Egg
|
# Egg
|
||||||
|
|
||||||
@@ -68,29 +69,30 @@
|
|||||||
size: 12
|
size: 12
|
||||||
- type: StorageFill
|
- type: StorageFill
|
||||||
contents:
|
contents:
|
||||||
- id: FoodEgg
|
- id: FoodEgg
|
||||||
amount: 12
|
amount: 12
|
||||||
- type: StorageCounter
|
- type: ItemCounter
|
||||||
countTag: Egg
|
count:
|
||||||
|
tags: [Egg]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: BagOpenCloseVisualizer
|
- type: BagOpenCloseVisualizer
|
||||||
openIcon: box-open
|
openIcon: box-open
|
||||||
- type: StackVisualizer
|
- type: StackVisualizer
|
||||||
composite: true
|
composite: true
|
||||||
stackLayers:
|
stackLayers:
|
||||||
- box1
|
- box1
|
||||||
- box2
|
- box2
|
||||||
- box3
|
- box3
|
||||||
- box4
|
- box4
|
||||||
- box5
|
- box5
|
||||||
- box6
|
- box6
|
||||||
- box7
|
- box7
|
||||||
- box8
|
- box8
|
||||||
- box9
|
- box9
|
||||||
- box10
|
- box10
|
||||||
- box11
|
- box11
|
||||||
- box12
|
- box12
|
||||||
# Someday...
|
# Someday...
|
||||||
# - type: DamageOnLand
|
# - type: DamageOnLand
|
||||||
# amount: 5
|
# amount: 5
|
||||||
@@ -123,8 +125,8 @@
|
|||||||
components:
|
components:
|
||||||
- type: StorageFill
|
- type: StorageFill
|
||||||
contents:
|
contents:
|
||||||
- id: Eggshells
|
- id: Eggshells
|
||||||
amount: 12
|
amount: 12
|
||||||
- type: Destructible
|
- type: Destructible
|
||||||
thresholds:
|
thresholds:
|
||||||
- trigger:
|
- trigger:
|
||||||
@@ -164,16 +166,16 @@
|
|||||||
# stackType: PizzaBox
|
# stackType: PizzaBox
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: StorageVisualizer
|
- type: StorageVisualizer
|
||||||
state_open: box-open
|
state_open: box-open
|
||||||
state_closed: box
|
state_closed: box
|
||||||
# - type: StackVisualizer
|
# - type: StackVisualizer
|
||||||
# stackLayers:
|
# stackLayers:
|
||||||
# - box
|
# - box
|
||||||
# - box1
|
# - box1
|
||||||
# - box2
|
# - box2
|
||||||
# - box3
|
# - box3
|
||||||
# - box4
|
# - box4
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: pizza box
|
name: pizza box
|
||||||
@@ -236,23 +238,24 @@
|
|||||||
HeldPrefix: box
|
HeldPrefix: box
|
||||||
- type: StorageFill
|
- type: StorageFill
|
||||||
contents:
|
contents:
|
||||||
- id: FoodBakedNugget
|
- id: FoodBakedNugget
|
||||||
amount: 6
|
amount: 6
|
||||||
- type: StorageCounter
|
- type: ItemCounter
|
||||||
countTag: Nugget
|
count:
|
||||||
|
tags: [Nugget]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: BagOpenCloseVisualizer
|
- type: BagOpenCloseVisualizer
|
||||||
openIcon: box-open
|
openIcon: box-open
|
||||||
- type: StackVisualizer
|
- type: StackVisualizer
|
||||||
composite: true
|
composite: true
|
||||||
stackLayers:
|
stackLayers:
|
||||||
- box1
|
- box1
|
||||||
- box2
|
- box2
|
||||||
- box3
|
- box3
|
||||||
- box4
|
- box4
|
||||||
- box5
|
- box5
|
||||||
- box6
|
- box6
|
||||||
|
|
||||||
# Donkpocket
|
# Donkpocket
|
||||||
|
|
||||||
@@ -277,8 +280,8 @@
|
|||||||
color: red
|
color: red
|
||||||
- type: StorageFill
|
- type: StorageFill
|
||||||
contents:
|
contents:
|
||||||
- id: FoodDonkpocket
|
- id: FoodDonkpocket
|
||||||
amount: 6
|
amount: 6
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: FoodBoxDonkpocket
|
parent: FoodBoxDonkpocket
|
||||||
@@ -291,8 +294,8 @@
|
|||||||
sprite: Objects/Consumable/Food/Baked/donkpocket.rsi
|
sprite: Objects/Consumable/Food/Baked/donkpocket.rsi
|
||||||
- type: StorageFill
|
- type: StorageFill
|
||||||
contents:
|
contents:
|
||||||
- id: FoodDonkpocketSpicy
|
- id: FoodDonkpocketSpicy
|
||||||
amount: 6
|
amount: 6
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: FoodBoxDonkpocket
|
parent: FoodBoxDonkpocket
|
||||||
@@ -305,8 +308,8 @@
|
|||||||
sprite: Objects/Consumable/Food/Baked/donkpocket.rsi
|
sprite: Objects/Consumable/Food/Baked/donkpocket.rsi
|
||||||
- type: StorageFill
|
- type: StorageFill
|
||||||
contents:
|
contents:
|
||||||
- id: FoodDonkpocketTeriyaki
|
- id: FoodDonkpocketTeriyaki
|
||||||
amount: 6
|
amount: 6
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: FoodBoxDonkpocket
|
parent: FoodBoxDonkpocket
|
||||||
@@ -320,8 +323,8 @@
|
|||||||
color: white
|
color: white
|
||||||
- type: StorageFill
|
- type: StorageFill
|
||||||
contents:
|
contents:
|
||||||
- id: FoodDonkpocketPizza
|
- id: FoodDonkpocketPizza
|
||||||
amount: 6
|
amount: 6
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: FoodBoxDonkpocket
|
parent: FoodBoxDonkpocket
|
||||||
@@ -335,8 +338,8 @@
|
|||||||
color: brown
|
color: brown
|
||||||
- type: StorageFill
|
- type: StorageFill
|
||||||
contents:
|
contents:
|
||||||
- id: FoodDonkpocketGondola
|
- id: FoodDonkpocketGondola
|
||||||
amount: 6
|
amount: 6
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: FoodBoxDonkpocket
|
parent: FoodBoxDonkpocket
|
||||||
@@ -349,8 +352,8 @@
|
|||||||
sprite: Objects/Consumable/Food/Baked/donkpocket.rsi
|
sprite: Objects/Consumable/Food/Baked/donkpocket.rsi
|
||||||
- type: StorageFill
|
- type: StorageFill
|
||||||
contents:
|
contents:
|
||||||
- id: FoodDonkpocketBerry
|
- id: FoodDonkpocketBerry
|
||||||
amount: 6
|
amount: 6
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: FoodBoxDonkpocket
|
parent: FoodBoxDonkpocket
|
||||||
@@ -364,8 +367,8 @@
|
|||||||
color: yellow
|
color: yellow
|
||||||
- type: StorageFill
|
- type: StorageFill
|
||||||
contents:
|
contents:
|
||||||
- id: FoodDonkpocketHonk
|
- id: FoodDonkpocketHonk
|
||||||
amount: 6
|
amount: 6
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: FoodBoxDonkpocket
|
parent: FoodBoxDonkpocket
|
||||||
@@ -380,5 +383,5 @@
|
|||||||
color: green
|
color: green
|
||||||
- type: StorageFill
|
- type: StorageFill
|
||||||
contents:
|
contents:
|
||||||
- id: FoodDonkpocketDink
|
- id: FoodDonkpocketDink
|
||||||
amount: 6
|
amount: 6
|
||||||
|
|||||||
@@ -13,24 +13,25 @@
|
|||||||
size: 6
|
size: 6
|
||||||
- type: StorageFill
|
- type: StorageFill
|
||||||
contents:
|
contents:
|
||||||
- id: Cigarette
|
- id: Cigarette
|
||||||
amount: 6
|
amount: 6
|
||||||
- type: StorageCounter
|
- type: ItemCounter
|
||||||
countTag: Cigarette
|
count:
|
||||||
|
tags: [Cigarette]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: BagOpenCloseVisualizer
|
- type: BagOpenCloseVisualizer
|
||||||
openIcon: open
|
openIcon: open
|
||||||
- type: StackVisualizer
|
- type: StackVisualizer
|
||||||
sprite: Objects/Consumable/Smokeables/Cigarettes/Packs/visualizer.rsi
|
sprite: Objects/Consumable/Smokeables/Cigarettes/Packs/visualizer.rsi
|
||||||
composite: true
|
composite: true
|
||||||
stackLayers:
|
stackLayers:
|
||||||
- cig1
|
- cig1
|
||||||
- cig2
|
- cig2
|
||||||
- cig3
|
- cig3
|
||||||
- cig4
|
- cig4
|
||||||
- cig5
|
- cig5
|
||||||
- cig6
|
- cig6
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
id: CigPackGreen
|
id: CigPackGreen
|
||||||
@@ -42,7 +43,7 @@
|
|||||||
netsync: false
|
netsync: false
|
||||||
sprite: Objects/Consumable/Smokeables/Cigarettes/Packs/green.rsi
|
sprite: Objects/Consumable/Smokeables/Cigarettes/Packs/green.rsi
|
||||||
layers:
|
layers:
|
||||||
- state: closed
|
- state: closed
|
||||||
- type: Item
|
- type: Item
|
||||||
sprite: Objects/Consumable/Smokeables/Cigarettes/Packs/green.rsi
|
sprite: Objects/Consumable/Smokeables/Cigarettes/Packs/green.rsi
|
||||||
size: 6
|
size: 6
|
||||||
@@ -57,7 +58,7 @@
|
|||||||
netsync: false
|
netsync: false
|
||||||
sprite: Objects/Consumable/Smokeables/Cigarettes/Packs/red.rsi
|
sprite: Objects/Consumable/Smokeables/Cigarettes/Packs/red.rsi
|
||||||
layers:
|
layers:
|
||||||
- state: closed
|
- state: closed
|
||||||
- type: Item
|
- type: Item
|
||||||
sprite: Objects/Consumable/Smokeables/Cigarettes/Packs/red.rsi
|
sprite: Objects/Consumable/Smokeables/Cigarettes/Packs/red.rsi
|
||||||
size: 6
|
size: 6
|
||||||
@@ -72,7 +73,7 @@
|
|||||||
netsync: false
|
netsync: false
|
||||||
sprite: Objects/Consumable/Smokeables/Cigarettes/Packs/blue.rsi
|
sprite: Objects/Consumable/Smokeables/Cigarettes/Packs/blue.rsi
|
||||||
layers:
|
layers:
|
||||||
- state: closed
|
- state: closed
|
||||||
- type: Item
|
- type: Item
|
||||||
sprite: Objects/Consumable/Smokeables/Cigarettes/Packs/blue.rsi
|
sprite: Objects/Consumable/Smokeables/Cigarettes/Packs/blue.rsi
|
||||||
size: 6
|
size: 6
|
||||||
@@ -87,7 +88,7 @@
|
|||||||
netsync: false
|
netsync: false
|
||||||
sprite: Objects/Consumable/Smokeables/Cigarettes/Packs/black.rsi
|
sprite: Objects/Consumable/Smokeables/Cigarettes/Packs/black.rsi
|
||||||
layers:
|
layers:
|
||||||
- state: closed
|
- state: closed
|
||||||
- type: Item
|
- type: Item
|
||||||
sprite: Objects/Consumable/Smokeables/Cigarettes/Packs/black.rsi
|
sprite: Objects/Consumable/Smokeables/Cigarettes/Packs/black.rsi
|
||||||
size: 6
|
size: 6
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
netsync: false
|
netsync: false
|
||||||
sprite: Objects/Consumable/Smokeables/Cigars/case.rsi
|
sprite: Objects/Consumable/Smokeables/Cigars/case.rsi
|
||||||
layers:
|
layers:
|
||||||
- state: closed
|
- state: closed
|
||||||
- type: Storage
|
- type: Storage
|
||||||
capacity: 8
|
capacity: 8
|
||||||
- type: Item
|
- type: Item
|
||||||
@@ -16,25 +16,26 @@
|
|||||||
size: 8
|
size: 8
|
||||||
- type: StorageFill
|
- type: StorageFill
|
||||||
contents:
|
contents:
|
||||||
- id: Cigar
|
- id: Cigar
|
||||||
amount: 8
|
amount: 8
|
||||||
- type: StorageCounter
|
- type: ItemCounter
|
||||||
countTag: Cigar
|
count:
|
||||||
|
tags: [Cigar]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: BagOpenCloseVisualizer
|
- type: BagOpenCloseVisualizer
|
||||||
openIcon: open
|
openIcon: open
|
||||||
- type: StackVisualizer
|
- type: StackVisualizer
|
||||||
composite: true
|
composite: true
|
||||||
stackLayers:
|
stackLayers:
|
||||||
- cigar1
|
- cigar1
|
||||||
- cigar2
|
- cigar2
|
||||||
- cigar3
|
- cigar3
|
||||||
- cigar4
|
- cigar4
|
||||||
- cigar5
|
- cigar5
|
||||||
- cigar6
|
- cigar6
|
||||||
- cigar7
|
- cigar7
|
||||||
- cigar8
|
- cigar8
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
id: CigarGoldCase
|
id: CigarGoldCase
|
||||||
@@ -44,5 +45,5 @@
|
|||||||
components:
|
components:
|
||||||
- type: StorageFill
|
- type: StorageFill
|
||||||
contents:
|
contents:
|
||||||
- id: CigarGold
|
- id: CigarGold
|
||||||
amount: 8
|
amount: 8
|
||||||
|
|||||||
@@ -193,8 +193,9 @@
|
|||||||
contents:
|
contents:
|
||||||
- id: DrinkColaCan
|
- id: DrinkColaCan
|
||||||
amount: 6
|
amount: 6
|
||||||
- type: StorageCounter
|
- type: ItemCounter
|
||||||
countTag: Cola
|
count:
|
||||||
|
tags: [Cola]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: StackVisualizer
|
- type: StackVisualizer
|
||||||
|
|||||||
@@ -203,8 +203,6 @@
|
|||||||
sprite: Objects/Fun/crayons.rsi
|
sprite: Objects/Fun/crayons.rsi
|
||||||
size: 9999
|
size: 9999
|
||||||
HeldPrefix: box
|
HeldPrefix: box
|
||||||
- type: StorageCounter
|
|
||||||
countTag: Crayon
|
|
||||||
- type: StorageFill
|
- type: StorageFill
|
||||||
contents:
|
contents:
|
||||||
- id: CrayonRed
|
- id: CrayonRed
|
||||||
@@ -214,7 +212,7 @@
|
|||||||
- id: CrayonBlue
|
- id: CrayonBlue
|
||||||
- id: CrayonPurple
|
- id: CrayonPurple
|
||||||
- id: CrayonBlack
|
- id: CrayonBlack
|
||||||
- type: ItemCounter
|
- type: ItemMapper
|
||||||
mapLayers:
|
mapLayers:
|
||||||
black_box:
|
black_box:
|
||||||
whitelist:
|
whitelist:
|
||||||
|
|||||||
@@ -63,8 +63,9 @@
|
|||||||
contents:
|
contents:
|
||||||
- id: Matchstick
|
- id: Matchstick
|
||||||
amount: 6
|
amount: 6
|
||||||
- type: StorageCounter
|
- type: ItemCounter
|
||||||
countTag: Matchstick
|
count:
|
||||||
|
tags: [Cigar]
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
visuals:
|
||||||
- type: BagOpenCloseVisualizer
|
- type: BagOpenCloseVisualizer
|
||||||
|
|||||||
Reference in New Issue
Block a user