Files
OldThink/Content.Shared/Audio/Jukebox/JukeboxComponent.cs

99 lines
2.4 KiB
C#

using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared.Audio.Jukebox;
[NetworkedComponent, RegisterComponent, AutoGenerateComponentState(true)]
[Access(typeof(SharedJukeboxSystem))]
public sealed partial class JukeboxComponent : Component
{
[DataField, AutoNetworkedField]
public ProtoId<JukeboxPrototype>? SelectedSongId;
[DataField, AutoNetworkedField]
public EntityUid? AudioStream;
[DataField, AutoNetworkedField]
public Queue<ProtoId<JukeboxPrototype>> SongIdQueue = new();
/// <summary>
/// RSI state for the jukebox being on.
/// </summary>
[DataField]
public string? OnState;
/// <summary>
/// RSI state for the jukebox being on.
/// </summary>
[DataField]
public string? OffState;
/// <summary>
/// RSI state for the jukebox track being selected.
/// </summary>
[DataField]
public string? SelectState;
[ViewVariables]
public bool Selecting;
[ViewVariables]
public float SelectAccumulator;
}
[RegisterComponent]
public sealed partial class JukeboxMusicComponent : Component;
[Serializable, NetSerializable]
public sealed class JukeboxPlayingMessage : BoundUserInterfaceMessage;
[Serializable, NetSerializable]
public sealed class JukeboxPauseMessage : BoundUserInterfaceMessage;
[Serializable, NetSerializable]
public sealed class JukeboxStopMessage : BoundUserInterfaceMessage;
[Serializable, NetSerializable]
public sealed class JukeboxSelectedMessage(ProtoId<JukeboxPrototype> songId) : BoundUserInterfaceMessage
{
public ProtoId<JukeboxPrototype> SongId { get; } = songId;
}
[Serializable, NetSerializable]
public sealed class JukeboxSetTimeMessage(float songTime) : BoundUserInterfaceMessage
{
public float SongTime { get; } = songTime;
}
[Serializable, NetSerializable]
public sealed class JukeboxAddQueueMessage(ProtoId<JukeboxPrototype> songId) : BoundUserInterfaceMessage
{
public ProtoId<JukeboxPrototype> SongId { get; } = songId;
}
[Serializable, NetSerializable]
public sealed class JukeboxRemoveQueueMessage(int index) : BoundUserInterfaceMessage
{
public int Index { get; } = index;
}
[Serializable, NetSerializable]
public enum JukeboxVisuals : byte
{
VisualState
}
[Serializable, NetSerializable]
public enum JukeboxVisualState : byte
{
On,
Off,
Select,
}
public enum JukeboxVisualLayers : byte
{
Base
}