Added bolts to airlocks (#1138)

Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
This commit is contained in:
Exp
2020-07-02 15:31:06 +02:00
committed by GitHub
parent 5fa1f23784
commit 8171e40a37
82 changed files with 176 additions and 43 deletions

View File

@@ -97,7 +97,7 @@ namespace Content.Client.GameObjects.Components.Doors
{
if (component.Owner.Deleted)
return;
var sprite = component.Owner.GetComponent<ISpriteComponent>();
var animPlayer = component.Owner.GetComponent<AnimationPlayerComponent>();
if (!component.TryGetData(DoorVisuals.VisualState, out DoorVisualState state))
@@ -106,11 +106,13 @@ namespace Content.Client.GameObjects.Components.Doors
}
var unlitVisible = true;
var boltedVisible = false;
switch (state)
{
case DoorVisualState.Closed:
sprite.LayerSetState(DoorVisualLayers.Base, "closed");
sprite.LayerSetState(DoorVisualLayers.BaseUnlit, "closed_unlit");
sprite.LayerSetState(DoorVisualLayers.BaseBolted, "bolted");
sprite.LayerSetState(WiresVisualizer2D.WiresVisualLayers.MaintenancePanel, "panel_open");
break;
case DoorVisualState.Closing:
@@ -143,14 +145,20 @@ namespace Content.Client.GameObjects.Components.Doors
{
unlitVisible = false;
}
if (component.TryGetData(DoorVisuals.BoltLights, out bool lights) && lights)
{
boltedVisible = true;
}
sprite.LayerSetVisible(DoorVisualLayers.BaseUnlit, unlitVisible);
sprite.LayerSetVisible(DoorVisualLayers.BaseBolted, unlitVisible && boltedVisible);
}
}
public enum DoorVisualLayers
{
Base,
BaseUnlit
BaseUnlit,
BaseBolted
}
}