Add basic PDA/Syndicate Uplink. (#942)

Co-authored-by: FL-OZ <anotherscuffed@gmail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
This commit is contained in:
FL-OZ
2020-05-28 06:22:47 -05:00
committed by GitHub
parent 0171c3bd93
commit 4c20a504a5
117 changed files with 1569 additions and 41 deletions

View File

@@ -0,0 +1,38 @@
using Content.Shared.GameObjects.Components.PDA;
using Robust.Client.GameObjects;
using Robust.Client.Interfaces.GameObjects.Components;
namespace Content.Client.GameObjects.Components.PDA
{
public class PDAVisualizer : AppearanceVisualizer
{
private enum PDAVisualLayers
{
Base,
Unlit
}
public override void OnChangeData(AppearanceComponent component)
{
base.OnChangeData(component);
if (component.Owner.Deleted)
{
return;
}
var sprite = component.Owner.GetComponent<ISpriteComponent>();
sprite.LayerSetVisible(PDAVisualLayers.Unlit, false);
if(!component.TryGetData<bool>(PDAVisuals.ScreenLit, out var isScreenLit))
{
return;
}
sprite.LayerSetState(PDAVisualLayers.Unlit, "unlit_pda_screen");
sprite.LayerSetVisible(PDAVisualLayers.Unlit, isScreenLit);
}
}
}