Files
tbd-station-14/Content.Shared/Speech/Components/MeleeSpeechComponent.cs
HerCoyote23 d1a0f5f09e Set max length of battlecry to 12 chars. (#16958)
* Set max length of battlecry to 12 chars. Deleted a duplicate file.

* Also cleanup some leftovers
2023-05-30 12:57:53 -05:00

54 lines
1.4 KiB
C#

using Content.Shared.Speech.EntitySystems;
using Robust.Shared.Serialization;
namespace Content.Shared.Speech.Components;
[RegisterComponent]
[AutoGenerateComponentState]
public sealed partial class MeleeSpeechComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)]
[DataField("Battlecry")]
[AutoNetworkedField]
public string? Battlecry;
[ViewVariables(VVAccess.ReadWrite)]
[DataField("MaxBattlecryLength")]
public int MaxBattlecryLength = 12;
}
/// <summary>
/// Key representing which <see cref="BoundUserInterface"/> is currently open.
/// Useful when there are multiple UI for an object. Here it's future-proofing only.
/// </summary>
[Serializable, NetSerializable]
public enum MeleeSpeechUiKey : byte
{
Key,
}
/// <summary>
/// Represents an <see cref="MeleeSpeechComponent"/> state that can be sent to the client
/// </summary>
[Serializable, NetSerializable]
public sealed class MeleeSpeechBoundUserInterfaceState : BoundUserInterfaceState
{
public string CurrentBattlecry { get; }
public MeleeSpeechBoundUserInterfaceState(string currentBattlecry)
{
CurrentBattlecry = currentBattlecry;
}
}
[Serializable, NetSerializable]
public sealed class MeleeSpeechBattlecryChangedMessage : BoundUserInterfaceMessage
{
public string Battlecry { get; }
public MeleeSpeechBattlecryChangedMessage(string battlecry)
{
Battlecry = battlecry;
}
}