]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Allow EmoteSoundsPrototype to have parents (#38890)
authorMr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>
Thu, 31 Jul 2025 13:22:33 +0000 (09:22 -0400)
committerGitHub <noreply@github.com>
Thu, 31 Jul 2025 13:22:33 +0000 (15:22 +0200)
* 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>
Content.Shared/Chat/Prototypes/EmoteSoundsPrototype.cs

index 4364e13d843474fb56ccf65db0a03cdb8aa7f9c0..0138009ef9c80367ad9c0bc942a8be91c9db4748 100644 (file)
@@ -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();
 }