Optionally deserialize AudioParams in SoundSpecifier (#8065)
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using Content.Shared.Audio;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
@@ -9,6 +11,9 @@ namespace Content.Shared.Sound
|
||||
[ImplicitDataDefinitionForInheritors]
|
||||
public abstract class SoundSpecifier
|
||||
{
|
||||
[DataField("params")]
|
||||
public AudioParams Params = AudioParams.Default;
|
||||
|
||||
public abstract string GetSound();
|
||||
}
|
||||
|
||||
@@ -19,6 +24,7 @@ namespace Content.Shared.Sound
|
||||
[DataField(Node, customTypeSerializer: typeof(ResourcePathSerializer), required: true)]
|
||||
public ResourcePath? Path { get; }
|
||||
|
||||
[UsedImplicitly]
|
||||
public SoundPathSpecifier()
|
||||
{
|
||||
}
|
||||
@@ -46,6 +52,7 @@ namespace Content.Shared.Sound
|
||||
[DataField(Node, customTypeSerializer: typeof(PrototypeIdSerializer<SoundCollectionPrototype>), required: true)]
|
||||
public string? Collection { get; }
|
||||
|
||||
[UsedImplicitly]
|
||||
public SoundCollectionSpecifier()
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user