Draw depth adjustments (#5130)

* door drawdepth toggle

* git mv

* dooooors

* drawdepth adjustments

* fix door and missed projectiles

* firelock depth tweak

* Get sprite only when needed

* single letter typo

* forgot to include closing in _activeDoors.
This commit is contained in:
Leon Friedrich
2021-11-04 02:43:10 +13:00
committed by GitHub
parent 40f866f35c
commit 673301825b
32 changed files with 103 additions and 100 deletions

View File

@@ -2,6 +2,11 @@ using System;
using Content.Shared.Doors;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
using DrawDepthTag = Robust.Shared.GameObjects.DrawDepth;
using DrawDepth = Content.Shared.DrawDepth.DrawDepth;
namespace Content.Client.Doors
{
@@ -13,6 +18,12 @@ namespace Content.Client.Doors
[ComponentReference(typeof(SharedDoorComponent))]
public class ClientDoorComponent : SharedDoorComponent
{
[DataField("openDrawDepth", customTypeSerializer: typeof(ConstantSerializer<DrawDepthTag>))]
public int OpenDrawDepth = (int) DrawDepth.Doors;
[DataField("closedDrawDepth", customTypeSerializer: typeof(ConstantSerializer<DrawDepthTag>))]
public int ClosedDrawDepth = (int) DrawDepth.Doors;
private bool _stateChangeHasProgressed = false;
private TimeSpan _timeOffset;
@@ -27,7 +38,7 @@ namespace Content.Client.Doors
base.State = value;
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new DoorStateMessage(this, State));
Owner.EntityManager.EventBus.RaiseLocalEvent(Owner.Uid, new DoorStateChangedEvent(State), false);
}
}
@@ -85,16 +96,4 @@ namespace Content.Client.Doors
}
}
}
public sealed class DoorStateMessage : EntityEventArgs
{
public ClientDoorComponent Component { get; }
public SharedDoorComponent.DoorState State { get; }
public DoorStateMessage(ClientDoorComponent component, SharedDoorComponent.DoorState state)
{
Component = component;
State = state;
}
}
}