mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
22 lines
858 B
C#
22 lines
858 B
C#
using Content.Shared.Instruments;
|
|
using Robust.Shared.Player;
|
|
using ActivatableUIComponent = Content.Shared.UserInterface.ActivatableUIComponent;
|
|
|
|
namespace Content.Server.Instruments;
|
|
|
|
[RegisterComponent]
|
|
public sealed partial class InstrumentComponent : SharedInstrumentComponent
|
|
{
|
|
[Dependency] private IEntityManager _entMan = default!;
|
|
|
|
[ViewVariables] public float Timer = 0f;
|
|
[ViewVariables] public int BatchesDropped = 0;
|
|
[ViewVariables] public int LaggedBatches = 0;
|
|
[ViewVariables] public int MidiEventCount = 0;
|
|
[ViewVariables] public uint LastSequencerTick = 0;
|
|
|
|
// TODO Instruments: Make this ECS
|
|
public EntityUid? InstrumentPlayer =>
|
|
_entMan.GetComponentOrNull<ActivatableUIComponent>(Owner)?.CurrentSingleUser
|
|
?? _entMan.GetComponentOrNull<ActorComponent>(Owner)?.PlayerSession.AttachedEntity;
|
|
}
|