EmotePrototype.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. using Content.Shared.Whitelist;
  2. using Robust.Shared.Prototypes;
  3. using Robust.Shared.Serialization;
  4. using Robust.Shared.Utility;
  5. namespace Content.Shared.Chat.Prototypes;
  6. /// <summary>
  7. /// IC emotes (scream, smile, clapping, etc).
  8. /// Entities can activate emotes by chat input, radial or code.
  9. /// </summary>
  10. [Prototype]
  11. public sealed partial class EmotePrototype : IPrototype
  12. {
  13. [IdDataField]
  14. public string ID { get; private set; } = default!;
  15. /// <summary>
  16. /// Localization string for the emote name. Displayed in the radial UI.
  17. /// </summary>
  18. [DataField(required: true)]
  19. public string Name = default!;
  20. /// <summary>
  21. /// Determines if emote available to all by default
  22. /// <see cref="Whitelist"/> check comes after this setting
  23. /// <see cref="Content.Shared.Speech.SpeechComponent.AllowedEmotes"/> can ignore this setting
  24. /// </summary>
  25. [DataField]
  26. public bool Available = true;
  27. /// <summary>
  28. /// Different emote categories may be handled by different systems.
  29. /// Also may be used for filtering.
  30. /// </summary>
  31. [DataField]
  32. public EmoteCategory Category = EmoteCategory.General;
  33. /// <summary>
  34. /// An icon used to visually represent the emote in radial UI.
  35. /// </summary>
  36. [DataField]
  37. public SpriteSpecifier Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/Actions/scream.png"));
  38. /// <summary>
  39. /// Determines conditions to this emote be available to use
  40. /// </summary>
  41. [DataField]
  42. public EntityWhitelist? Whitelist;
  43. /// <summary>
  44. /// Determines conditions to this emote be unavailable to use
  45. /// </summary>
  46. [DataField]
  47. public EntityWhitelist? Blacklist;
  48. /// <summary>
  49. /// Collection of words that will be sent to chat if emote activates.
  50. /// Will be picked randomly from list.
  51. /// </summary>
  52. [DataField]
  53. public List<string> ChatMessages = new();
  54. /// <summary>
  55. /// Trigger words for emote. Case independent.
  56. /// When typed into players chat they will activate emote event.
  57. /// All words should be unique across all emote prototypes.
  58. /// </summary>
  59. [DataField]
  60. public HashSet<string> ChatTriggers = new();
  61. }
  62. /// <summary>
  63. /// IC emote category. Usually physical source of emote,
  64. /// like hands, voice, face, etc.
  65. /// </summary>
  66. [Flags]
  67. [Serializable, NetSerializable]
  68. public enum EmoteCategory : byte
  69. {
  70. Invalid = 0,
  71. Vocal = 1 << 0,
  72. Hands = 1 << 1,
  73. General = byte.MaxValue
  74. }