1
0

EncryptionKeyHolderComponent.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using Content.Shared.Chat;
  2. using Content.Shared.Tools;
  3. using Robust.Shared.Audio;
  4. using Robust.Shared.Containers;
  5. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  6. namespace Content.Shared.Radio.Components;
  7. /// <summary>
  8. /// This component is by entities that can contain encryption keys
  9. /// </summary>
  10. [RegisterComponent]
  11. public sealed partial class EncryptionKeyHolderComponent : Component
  12. {
  13. /// <summary>
  14. /// Whether or not encryption keys can be removed from the headset.
  15. /// </summary>
  16. [ViewVariables(VVAccess.ReadWrite)]
  17. [DataField("keysUnlocked")]
  18. public bool KeysUnlocked = true;
  19. /// <summary>
  20. /// The tool required to extract the encryption keys from the headset.
  21. /// </summary>
  22. [ViewVariables(VVAccess.ReadWrite)]
  23. [DataField("keysExtractionMethod", customTypeSerializer: typeof(PrototypeIdSerializer<ToolQualityPrototype>))]
  24. public string KeysExtractionMethod = "Screwing";
  25. [ViewVariables(VVAccess.ReadWrite)]
  26. [DataField("keySlots")]
  27. public int KeySlots = 2;
  28. [ViewVariables(VVAccess.ReadWrite)]
  29. [DataField("keyExtractionSound")]
  30. public SoundSpecifier KeyExtractionSound = new SoundPathSpecifier("/Audio/Items/pistol_magout.ogg");
  31. [ViewVariables(VVAccess.ReadWrite)]
  32. [DataField("keyInsertionSound")]
  33. public SoundSpecifier KeyInsertionSound = new SoundPathSpecifier("/Audio/Items/pistol_magin.ogg");
  34. [ViewVariables]
  35. public Container KeyContainer = default!;
  36. public const string KeyContainerName = "key_slots";
  37. /// <summary>
  38. /// Combined set of radio channels provided by all contained keys.
  39. /// </summary>
  40. [ViewVariables]
  41. public HashSet<string> Channels = new();
  42. /// <summary>
  43. /// This is the channel that will be used when using the default/department prefix (<see cref="SharedChatSystem.DefaultChannelKey"/>).
  44. /// </summary>
  45. [ViewVariables]
  46. public string? DefaultChannel;
  47. }