Files
space-station-14/Content.Shared/VoiceMask/VoiceMaskComponent.cs
Leah 0e86bd45bd Identity Mask now updates equipped Agent ID name (#42772)
* add identity mask updating agent id functionality

* fix indentation

* add check for voice mask item

* use ChangeIDName field instead

* Minor cleanup

* remove trycomp

---------

Co-authored-by: beck-thompson <beck314159@hotmail.com>
2026-02-13 21:42:16 +00:00

66 lines
1.9 KiB
C#

using Content.Shared.Speech;
using Robust.Shared.Prototypes;
namespace Content.Shared.VoiceMask;
/// <summary>
/// This component is for voice mask items! Adding this component to clothing will give the the voice mask UI
/// and allow the wearer to change their voice and verb at will.
/// </summary>
/// <remarks>
/// DO NOT use this if you do not want the interface.
/// The VoiceOverrideSystem is probably what your looking for (Or you might have to make something similar)!
/// </remarks>
[RegisterComponent]
public sealed partial class VoiceMaskComponent : Component
{
/// <summary>
/// The name that will override an entities default name. If null, it will use the default override.
/// </summary>
[DataField]
public string? VoiceMaskName = null;
/// <summary>
/// The speech verb that will override an entities default one. If null, it will use the entities default verb.
/// </summary>
[DataField]
public ProtoId<SpeechVerbPrototype>? VoiceMaskSpeechVerb;
/// <summary>
/// If true will override the users identity with whatever <see cref="VoiceMaskName"/> is.
/// </summary>
[DataField]
public bool OverrideIdentity;
/// <summary>
/// The action that gets displayed when the voice mask is equipped.
/// </summary>
[DataField]
public EntProtoId Action = "ActionChangeVoiceMask";
/// <summary>
/// Reference to the action.
/// </summary>
[DataField]
public EntityUid? ActionEntity;
/// <summary>
/// If user's voice is getting changed when they speak.
/// </summary>
[DataField]
public bool Active = true;
/// <summary>
/// If user's accent is getting hidden when they speak.
/// </summary>
[DataField]
public bool AccentHide = true;
/// <summary>
/// If user's equipped agent id name is getting changed.
/// </summary>
[DataField]
public bool ChangeIDName = false;
}