2021-06-09 22:19:39 +02:00
|
|
|
using Content.Server.UserInterface;
|
|
|
|
|
using Content.Shared.Instruments;
|
2019-11-25 00:11:47 +01:00
|
|
|
using Robust.Server.GameObjects;
|
2023-10-24 21:55:20 +11:00
|
|
|
using Robust.Server.Player;
|
2019-11-25 00:11:47 +01:00
|
|
|
|
2021-11-28 01:47:36 +01:00
|
|
|
namespace Content.Server.Instruments;
|
2019-11-25 00:11:47 +01:00
|
|
|
|
2023-09-12 14:43:06 +10:00
|
|
|
[RegisterComponent]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class InstrumentComponent : SharedInstrumentComponent
|
2021-11-28 01:47:36 +01:00
|
|
|
{
|
2021-12-08 17:17:12 +01:00
|
|
|
[Dependency] private readonly IEntityManager _entMan = default!;
|
|
|
|
|
|
2023-07-16 21:12:53 +02:00
|
|
|
[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;
|
2022-04-08 16:22:05 +02:00
|
|
|
|
2021-12-08 17:17:12 +01:00
|
|
|
// TODO Instruments: Make this ECS
|
2023-10-24 21:55:20 +11:00
|
|
|
public IPlayerSession? InstrumentPlayer =>
|
2021-12-08 17:17:12 +01:00
|
|
|
_entMan.GetComponentOrNull<ActivatableUIComponent>(Owner)?.CurrentSingleUser
|
|
|
|
|
?? _entMan.GetComponentOrNull<ActorComponent>(Owner)?.PlayerSession;
|
2019-11-25 00:11:47 +01:00
|
|
|
}
|
2022-04-04 23:08:36 -07:00
|
|
|
|
|
|
|
|
[RegisterComponent]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class ActiveInstrumentComponent : Component
|
2023-07-16 21:12:53 +02:00
|
|
|
{
|
|
|
|
|
}
|