2019-07-19 18:09:33 +10:00
|
|
|
using System;
|
|
|
|
|
using Content.Shared.GameObjects.Components.Movement;
|
2020-10-10 13:32:42 +02:00
|
|
|
using Content.Shared.GameObjects.Components.Portal;
|
2019-07-19 18:09:33 +10:00
|
|
|
using JetBrains.Annotations;
|
|
|
|
|
using Robust.Client.GameObjects;
|
|
|
|
|
using Robust.Client.Interfaces.GameObjects.Components;
|
|
|
|
|
|
|
|
|
|
namespace Content.Client.GameObjects.Components.Movement
|
|
|
|
|
{
|
|
|
|
|
[UsedImplicitly]
|
2020-07-23 00:56:53 +02:00
|
|
|
public class HandTeleporterVisualizer : AppearanceVisualizer
|
2019-07-19 18:09:33 +10:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public override void OnChangeData(AppearanceComponent component)
|
|
|
|
|
{
|
|
|
|
|
var sprite = component.Owner.GetComponent<ISpriteComponent>();
|
|
|
|
|
if (!component.TryGetData(TeleporterVisuals.VisualState, out TeleporterVisualState state))
|
|
|
|
|
{
|
|
|
|
|
state = TeleporterVisualState.Ready;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (state)
|
|
|
|
|
{
|
|
|
|
|
case TeleporterVisualState.Charging:
|
|
|
|
|
sprite.LayerSetState(0, "charging");
|
|
|
|
|
break;
|
|
|
|
|
case TeleporterVisualState.Ready:
|
|
|
|
|
sprite.LayerSetState(0, "ready");
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
throw new ArgumentOutOfRangeException();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|