Allow EmoteSoundsPrototype to have parents (#38890)
* inital * Update Content.Shared/Chat/Prototypes/EmoteSoundsPrototype.cs Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> * ProtoId * Unneeded * Update Content.Shared/Chat/Prototypes/EmoteSoundsPrototype.cs * Update Content.Shared/Chat/Prototypes/EmoteSoundsPrototype.cs --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Array;
|
||||
|
||||
namespace Content.Shared.Chat.Prototypes;
|
||||
|
||||
@@ -10,11 +9,20 @@ namespace Content.Shared.Chat.Prototypes;
|
||||
/// Different entities may use different sounds collections.
|
||||
/// </summary>
|
||||
[Prototype]
|
||||
public sealed partial class EmoteSoundsPrototype : IPrototype
|
||||
public sealed partial class EmoteSoundsPrototype : IPrototype, IInheritingPrototype
|
||||
{
|
||||
[IdDataField]
|
||||
public string ID { get; private set; } = default!;
|
||||
|
||||
/// <inheritdoc/>
|
||||
[ParentDataField(typeof(AbstractPrototypeIdArraySerializer<EmoteSoundsPrototype>))]
|
||||
public string[]? Parents { get; private set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
[AbstractDataField]
|
||||
[NeverPushInheritance]
|
||||
public bool Abstract { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional fallback sound that will play if collection
|
||||
/// doesn't have specific sound for this emote id.
|
||||
@@ -32,6 +40,7 @@ public sealed partial class EmoteSoundsPrototype : IPrototype
|
||||
/// <summary>
|
||||
/// Collection of emote prototypes and their sounds.
|
||||
/// </summary>
|
||||
[DataField("sounds", customTypeSerializer: typeof(PrototypeIdDictionarySerializer<SoundSpecifier, EmotePrototype>))]
|
||||
public Dictionary<string, SoundSpecifier> Sounds = new();
|
||||
[DataField]
|
||||
[AlwaysPushInheritance]
|
||||
public Dictionary<ProtoId<EmotePrototype>, SoundSpecifier> Sounds = new();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user