Content fixes for engine PR (#39086)
* content changes for engine PR * rerun tests
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Sound.Components;
|
||||
|
||||
@@ -13,25 +11,13 @@ public abstract partial class BaseEmitSoundComponent : Component
|
||||
/// <summary>
|
||||
/// The <see cref="SoundSpecifier"/> to play.
|
||||
/// </summary>
|
||||
[DataField(required: true)]
|
||||
[DataField(required: true), AutoNetworkedField]
|
||||
public SoundSpecifier? Sound;
|
||||
|
||||
/// <summary>
|
||||
/// Play the sound at the position instead of parented to the source entity.
|
||||
/// Useful if the entity is deleted after.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
[DataField, AutoNetworkedField]
|
||||
public bool Positional;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents the state of <see cref="BaseEmitSoundComponent"/>.
|
||||
/// </summary>
|
||||
/// <remarks>This is obviously very cursed, but since the BaseEmitSoundComponent is abstract, we cannot network it.
|
||||
/// AutoGenerateComponentState attribute won't work here, and since everything revolves around inheritance for some fucking reason,
|
||||
/// there's no better way of doing this.</remarks>
|
||||
[Serializable, NetSerializable]
|
||||
public struct EmitSoundComponentState(SoundSpecifier? sound) : IComponentState
|
||||
{
|
||||
public SoundSpecifier? Sound { get; } = sound;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Content.Shared.Sound.Components;
|
||||
/// <summary>
|
||||
/// Simple sound emitter that emits sound on ActivateInWorld
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
public sealed partial class EmitSoundOnActivateComponent : BaseEmitSoundComponent
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -3,7 +3,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||
|
||||
namespace Content.Shared.Sound.Components;
|
||||
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause, AutoGenerateComponentState]
|
||||
public sealed partial class EmitSoundOnCollideComponent : BaseEmitSoundComponent
|
||||
{
|
||||
public static readonly TimeSpan CollideCooldown = TimeSpan.FromSeconds(0.2);
|
||||
|
||||
@@ -5,5 +5,5 @@ namespace Content.Shared.Sound.Components;
|
||||
/// <summary>
|
||||
/// Simple sound emitter that emits sound on entity drop
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
public sealed partial class EmitSoundOnDropComponent : BaseEmitSoundComponent;
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Content.Shared.Sound.Components;
|
||||
/// <summary>
|
||||
/// Whenever this item is used upon by an entity, with a tag or component within a whitelist, in the hand of a user, play a sound
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
public sealed partial class EmitSoundOnInteractUsingComponent : BaseEmitSoundComponent
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -5,5 +5,5 @@ namespace Content.Shared.Sound.Components;
|
||||
/// <summary>
|
||||
/// Simple sound emitter that emits sound on LandEvent
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
public sealed partial class EmitSoundOnLandComponent : BaseEmitSoundComponent;
|
||||
|
||||
@@ -5,5 +5,5 @@ namespace Content.Shared.Sound.Components;
|
||||
/// <summary>
|
||||
/// Simple sound emitter that emits sound on entity pickup
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
public sealed partial class EmitSoundOnPickupComponent : BaseEmitSoundComponent;
|
||||
|
||||
@@ -5,5 +5,5 @@ namespace Content.Shared.Sound.Components;
|
||||
/// <summary>
|
||||
/// Simple sound emitter that emits sound on entity spawn.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
public sealed partial class EmitSoundOnSpawnComponent : BaseEmitSoundComponent;
|
||||
|
||||
@@ -5,5 +5,5 @@ namespace Content.Shared.Sound.Components;
|
||||
/// <summary>
|
||||
/// Simple sound emitter that emits sound on ThrowEvent
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
public sealed partial class EmitSoundOnThrowComponent : BaseEmitSoundComponent;
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Content.Shared.Sound.Components;
|
||||
/// <summary>
|
||||
/// Simple sound emitter that emits sound on AfterActivatableUIOpenEvent
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
public sealed partial class EmitSoundOnUIOpenComponent : BaseEmitSoundComponent
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Content.Shared.Sound.Components;
|
||||
/// <summary>
|
||||
/// Simple sound emitter that emits sound on UseInHand
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
public sealed partial class EmitSoundOnUseComponent : BaseEmitSoundComponent
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user