artifact crusher (#22301)

This commit is contained in:
Nemanja
2023-12-11 18:15:47 -05:00
committed by GitHub
parent 0433d3b06a
commit 6e91346ff3
23 changed files with 501 additions and 1 deletions

View File

@@ -37,15 +37,27 @@ public sealed class EntityStorageVisualizerSystem : VisualizerSystem<EntityStora
{
if (open)
{
args.Sprite.LayerSetVisible(StorageVisualLayers.Door, true);
if (comp.OpenDrawDepth != null)
args.Sprite.DrawDepth = comp.OpenDrawDepth.Value;
if (comp.StateDoorOpen != null)
{
args.Sprite.LayerSetState(StorageVisualLayers.Door, comp.StateDoorOpen);
args.Sprite.LayerSetVisible(StorageVisualLayers.Door, true);
}
else
{
args.Sprite.LayerSetVisible(StorageVisualLayers.Door, false);
}
if (comp.StateBaseOpen != null)
args.Sprite.LayerSetState(StorageVisualLayers.Base, comp.StateBaseOpen);
}
else
{
if (comp.ClosedDrawDepth != null)
args.Sprite.DrawDepth = comp.ClosedDrawDepth.Value;
if (comp.StateDoorClosed != null)
{
args.Sprite.LayerSetState(StorageVisualLayers.Door, comp.StateDoorClosed);

View File

@@ -45,4 +45,16 @@ public sealed partial class EntityStorageVisualsComponent : Component
[DataField("stateUnlocked")]
[ViewVariables(VVAccess.ReadWrite)]
public string? StateUnlocked = "unlocked";
/// <summary>
/// The drawdepth the object has when it's open
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public int? OpenDrawDepth;
/// <summary>
/// The drawdepth the object has when it's closed
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public int? ClosedDrawDepth;
}