Meleespeech Action, Holoparasite Meleespeech (#19504)
This commit is contained in:
@@ -1,21 +1,43 @@
|
||||
using Content.Shared.Speech.EntitySystems;
|
||||
using Content.Shared.Actions;
|
||||
using Content.Shared.Actions.ActionTypes;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Speech.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[AutoGenerateComponentState]
|
||||
|
||||
public sealed partial class MeleeSpeechComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The battlecry to be said when an entity attacks with this component
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("Battlecry")]
|
||||
[AutoNetworkedField]
|
||||
public string? Battlecry;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("Battlecry")]
|
||||
[AutoNetworkedField]
|
||||
public string? Battlecry;
|
||||
|
||||
/// <summary>
|
||||
/// The maximum amount of characters allowed in a battlecry
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("MaxBattlecryLength")]
|
||||
[AutoNetworkedField]
|
||||
public int MaxBattlecryLength = 12;
|
||||
|
||||
/// <summary>
|
||||
/// The action to open the battlecry UI
|
||||
/// </summary>
|
||||
[DataField("configureAction")]
|
||||
public InstantAction ConfigureAction = new()
|
||||
{
|
||||
UseDelay = TimeSpan.FromSeconds(1),
|
||||
ItemIconStyle = ItemActionIconStyle.BigItem,
|
||||
DisplayName = "melee-speech-config",
|
||||
Description = "melee-speech-config-desc",
|
||||
Priority = -20,
|
||||
Event = new MeleeSpeechConfigureActionEvent(),
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -35,7 +57,6 @@ public enum MeleeSpeechUiKey : byte
|
||||
public sealed class MeleeSpeechBoundUserInterfaceState : BoundUserInterfaceState
|
||||
{
|
||||
public string CurrentBattlecry { get; }
|
||||
|
||||
public MeleeSpeechBoundUserInterfaceState(string currentBattlecry)
|
||||
{
|
||||
CurrentBattlecry = currentBattlecry;
|
||||
@@ -51,3 +72,5 @@ public sealed class MeleeSpeechBattlecryChangedMessage : BoundUserInterfaceMessa
|
||||
Battlecry = battlecry;
|
||||
}
|
||||
}
|
||||
|
||||
public sealed partial class MeleeSpeechConfigureActionEvent : InstantActionEvent { }
|
||||
|
||||
Reference in New Issue
Block a user