using Content.Shared.Actions;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Shared.Speech.Components;
[RegisterComponent, NetworkedComponent]
[AutoGenerateComponentState]
public sealed partial class MeleeSpeechComponent : Component
{
///
/// The battlecry to be said when an entity attacks with this component
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField("Battlecry")]
[AutoNetworkedField]
public string? Battlecry;
///
/// The maximum amount of characters allowed in a battlecry
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField("MaxBattlecryLength")]
[AutoNetworkedField]
public int MaxBattlecryLength = 12;
[DataField] public EntProtoId ConfigureAction = "ActionConfigureMeleeSpeech";
///
/// The action to open the battlecry UI
///
[DataField("configureActionEntity")] public EntityUid? ConfigureActionEntity;
}
///
/// Key representing which is currently open.
/// Useful when there are multiple UI for an object. Here it's future-proofing only.
///
[Serializable, NetSerializable]
public enum MeleeSpeechUiKey : byte
{
Key,
}
///
/// Represents an state that can be sent to the client
///
[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;
}
}
public sealed partial class MeleeSpeechConfigureActionEvent : InstantActionEvent { }