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:
38
Content.Client/GameObjects/Components/PDA/PDAVisualizer.cs
Normal file
38
Content.Client/GameObjects/Components/PDA/PDAVisualizer.cs
Normal 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);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user