1
0

EmoteSoundsPrototype.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using Robust.Shared.Audio;
  2. using Robust.Shared.Prototypes;
  3. using Robust.Shared.Serialization;
  4. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
  5. namespace Content.Shared.Chat.Prototypes;
  6. /// <summary>
  7. /// Sounds collection for each <see cref="EmotePrototype"/>.
  8. /// Different entities may use different sounds collections.
  9. /// </summary>
  10. [Prototype, Serializable, NetSerializable]
  11. public sealed partial class EmoteSoundsPrototype : IPrototype
  12. {
  13. [IdDataField]
  14. public string ID { get; private set; } = default!;
  15. /// <summary>
  16. /// Optional fallback sound that will play if collection
  17. /// doesn't have specific sound for this emote id.
  18. /// </summary>
  19. [DataField("sound")]
  20. public SoundSpecifier? FallbackSound;
  21. /// <summary>
  22. /// Optional audio params that will be applied to ALL sounds.
  23. /// This will overwrite any params that may be set in sound specifiers.
  24. /// </summary>
  25. [DataField("params")]
  26. public AudioParams? GeneralParams;
  27. /// <summary>
  28. /// Collection of emote prototypes and their sounds.
  29. /// </summary>
  30. [DataField("sounds", customTypeSerializer: typeof(PrototypeIdDictionarySerializer<SoundSpecifier, EmotePrototype>))]
  31. public Dictionary<string, SoundSpecifier> Sounds = new();
  32. }