Files
tbd-station-14/Content.Client/Vehicle/VehicleVisualsSystem.cs
metalgearsloth b9e876ca92 The real movement refactor (#9645)
* The real movement refactor

* ref events

* Jetpack cleanup

* a

* Vehicles partially working

* Balance tweaks

* Restore some shitcode

* AAAAAAAA

* Even more prediction

* ECS compstate trying to fix this

* yml

* vehicles kill me

* Don't lock keys

* a

* Fix problem

* Fix sounds

* shuttle inputs

* Shuttle controls

* space brakes

* Keybinds

* Fix merge

* Handle shutdown

* Fix keys

* Bump friction

* fix buckle offset

* Fix relay and friction

* Fix jetpack turning

* contexts amirite
2022-07-16 13:51:52 +10:00

36 lines
1.1 KiB
C#

using Robust.Client.GameObjects;
using Content.Shared.Vehicle;
namespace Content.Client.Vehicle
{
/// <summary>
/// Controls client-side visuals for
/// vehicles
/// </summary>
public sealed class VehicleVisualsSystem : VisualizerSystem<VehicleVisualsComponent>
{
protected override void OnAppearanceChange(EntityUid uid, VehicleVisualsComponent component, ref AppearanceChangeEvent args)
{
if (args.Sprite == null)
return;
// First check is for the sprite itself
if (args.Component.TryGetData(VehicleVisuals.DrawDepth, out int drawDepth))
{
args.Sprite.DrawDepth = drawDepth;
}
// Set vehicle layer to animated or not (i.e. are the wheels turning or not)
if (args.Component.TryGetData(VehicleVisuals.AutoAnimate, out bool autoAnimate))
{
args.Sprite.LayerSetAutoAnimated(VehicleVisualLayers.AutoAnimate, autoAnimate);
}
}
}
}
public enum VehicleVisualLayers : byte
{
/// Layer for the vehicle's wheels
AutoAnimate,
}