Eris computer sprites, visualizer.

This commit is contained in:
Pieter-Jan Briers
2019-08-12 18:00:02 +02:00
parent a2e6500d54
commit d4384aef73
83 changed files with 588 additions and 230 deletions

View File

@@ -0,0 +1,34 @@
using Content.Server.GameObjects.Components.Power;
using Content.Shared.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
namespace Content.Server.GameObjects.Components
{
[RegisterComponent]
public sealed class ComputerComponent : SharedComputerComponent
{
public override void Initialize()
{
base.Initialize();
if (Owner.TryGetComponent(out PowerDeviceComponent powerDevice))
{
powerDevice.OnPowerStateChanged += PowerDeviceOnOnPowerStateChanged;
if (Owner.TryGetComponent(out AppearanceComponent appearance))
{
appearance.SetData(ComputerVisuals.Powered, powerDevice.Powered);
}
}
}
private void PowerDeviceOnOnPowerStateChanged(object sender, PowerStateEventArgs e)
{
if (Owner.TryGetComponent(out AppearanceComponent appearance))
{
appearance.SetData(ComputerVisuals.Powered, e.Powered);
}
}
}
}