Files
space-station-14/Content.Server/VoiceMask/VoiceMaskComponent.cs
alexalexmax 4ff7411fb7 Voice mask effects are toggleable and hide your accent (#41965)
* apply negate accents system

* add toggle to voice mask ui

* roll negateaccents into voice mask system, delete negate accents comp&system, update yml entries

* convert button to ToggleButton and some cleanup

* retry for heisenfail

* accent toggle

* update names and add mask active check for accent hiding
2025-12-26 02:47:05 +00:00

60 lines
1.8 KiB
C#

using Content.Shared.Speech;
using Robust.Shared.Prototypes;
namespace Content.Server.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;
}