2022-10-16 13:44:50 -04:00
|
|
|
namespace Content.Server.Explosion.Components
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sends a trigger when the keyphrase is heard
|
|
|
|
|
/// </summary>
|
|
|
|
|
[RegisterComponent]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class TriggerOnVoiceComponent : Component
|
2022-10-16 13:44:50 -04:00
|
|
|
{
|
2022-11-15 17:09:27 +13:00
|
|
|
public bool IsListening => IsRecording || !string.IsNullOrWhiteSpace(KeyPhrase);
|
2022-10-16 13:44:50 -04:00
|
|
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
[DataField("keyPhrase")]
|
|
|
|
|
public string? KeyPhrase;
|
|
|
|
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
[DataField("listenRange")]
|
|
|
|
|
public int ListenRange { get; private set; } = 4;
|
|
|
|
|
|
2022-11-15 17:09:27 +13:00
|
|
|
[DataField("isRecording")]
|
2022-10-16 13:44:50 -04:00
|
|
|
public bool IsRecording = false;
|
|
|
|
|
|
|
|
|
|
[DataField("minLength")]
|
|
|
|
|
public int MinLength = 3;
|
|
|
|
|
|
|
|
|
|
[DataField("maxLength")]
|
|
|
|
|
public int MaxLength = 50;
|
|
|
|
|
}
|
|
|
|
|
}
|