mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
# Description IPCs were ported from a codebase that didn't necessarily follow all of our repo's coding standards. And while I had done my part to cleanup as much of the system as was practical within the bounds of a Maintainer Review, there were a lot of things that I felt were inappropriate to leave to review, and wished to go over with a fine lense. Thus, here is my Refactor of IPC code. Do not merge this without first testing that nothing was broken. Because I haven't tested it myself yet.
58 lines
1.9 KiB
C#
58 lines
1.9 KiB
C#
using Content.Shared.Chat;
|
|
using Content.Shared.Tools;
|
|
using Robust.Shared.Audio;
|
|
using Robust.Shared.Containers;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
|
|
|
namespace Content.Shared.Radio.Components;
|
|
|
|
/// <summary>
|
|
/// This component is by entities that can contain encryption keys
|
|
/// </summary>
|
|
[RegisterComponent]
|
|
public sealed partial class EncryptionKeyHolderComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// Whether or not encryption keys can be removed from the headset.
|
|
/// </summary>
|
|
[DataField]
|
|
public bool KeysUnlocked = true;
|
|
|
|
/// <summary>
|
|
/// The tool required to extract the encryption keys from the headset.
|
|
/// </summary>
|
|
[DataField(customTypeSerializer: typeof(PrototypeIdSerializer<ToolQualityPrototype>))]
|
|
public string KeysExtractionMethod = "Screwing";
|
|
|
|
[DataField]
|
|
public int KeySlots = 2;
|
|
|
|
[DataField]
|
|
public SoundSpecifier KeyExtractionSound = new SoundPathSpecifier("/Audio/Items/pistol_magout.ogg");
|
|
|
|
[DataField]
|
|
public SoundSpecifier KeyInsertionSound = new SoundPathSpecifier("/Audio/Items/pistol_magin.ogg");
|
|
|
|
[ViewVariables]
|
|
public Container KeyContainer = default!;
|
|
public const string KeyContainerName = "key_slots";
|
|
|
|
/// <summary>
|
|
/// Whether or not the headset can be examined to see the encryption keys while the keys aren't accessible.
|
|
/// </summary>
|
|
[DataField]
|
|
public bool ExamineWhileLocked = true;
|
|
|
|
/// <summary>
|
|
/// Combined set of radio channels provided by all contained keys.
|
|
/// </summary>
|
|
[ViewVariables]
|
|
public HashSet<string> Channels = new();
|
|
|
|
/// <summary>
|
|
/// This is the channel that will be used when using the default/department prefix (<see cref="SharedChatSystem.DefaultChannelKey"/>).
|
|
/// </summary>
|
|
[ViewVariables]
|
|
public string? DefaultChannel;
|
|
}
|