Added Jukebox (#26736)

* Added Jukebox, along with music for jukebox

* Fixed Jukebox meta.json copyright

* Removed songs I couldn't find a license for.

* Renamed files to solve check failures from spaces

* Added missing attributions.yml

* Fixed lack of description in Jukebox

* Jukebox is now constructable.

* Change Jukebox menu to FancyWindow

* Moved Jukebox messages out of jukebox component

* Removed Jukebox OnValueChanged.

* JukeboxComp now uses AutoGenerateComponentState

* Removed state code, since it's auto generated

* Fixed various Jukebox code to match conventions.

* Updated Standard.yml to match changed song list.

* fixes

* Jukebox workin

* Fix

* Polishing

* Finalising

* Revert

* bad

* jukey

* Reviews

* name

* Update submodule to 218.2.0

---------

Co-authored-by: iNVERTED <alextjorgensen@gmail.com>
This commit is contained in:
metalgearsloth
2024-04-17 19:27:00 +10:00
committed by GitHub
parent 177d69cb98
commit 2db374988c
27 changed files with 907 additions and 1 deletions

View File

@@ -0,0 +1,80 @@
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;
/// <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;
}
[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 enum JukeboxVisuals : byte
{
VisualState
}
[Serializable, NetSerializable]
public enum JukeboxVisualState : byte
{
On,
Off,
Select,
}
public enum JukeboxVisualLayers : byte
{
Base
}

View File

@@ -0,0 +1,23 @@
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
namespace Content.Shared.Audio.Jukebox;
/// <summary>
/// Soundtrack that's visible on the jukebox list.
/// </summary>
[Prototype]
public sealed class JukeboxPrototype : IPrototype
{
[IdDataField]
public string ID { get; } = string.Empty;
/// <summary>
/// User friendly name to use in UI.
/// </summary>
[DataField(required: true)]
public string Name = string.Empty;
[DataField(required: true)]
public SoundPathSpecifier Path = default!;
}

View File

@@ -0,0 +1,11 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared.Audio.Jukebox;
[Serializable, NetSerializable]
public enum JukeboxUiKey : byte
{
Key,
}

View File

@@ -0,0 +1,8 @@
using Robust.Shared.Audio.Systems;
namespace Content.Shared.Audio.Jukebox;
public abstract class SharedJukeboxSystem : EntitySystem
{
[Dependency] protected readonly SharedAudioSystem Audio = default!;
}