Refactor actions to be entities with components (#19900)
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
using Content.Shared.Actions;
|
||||
using Content.Shared.Actions.ActionTypes;
|
||||
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]
|
||||
@@ -25,19 +27,13 @@ public sealed partial class MeleeSpeechComponent : Component
|
||||
[AutoNetworkedField]
|
||||
public int MaxBattlecryLength = 12;
|
||||
|
||||
[DataField("configureAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||
public string? ConfigureAction = "ActionConfigureMeleeSpeech";
|
||||
|
||||
/// <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(),
|
||||
};
|
||||
[DataField("configureActionEntity")] public EntityUid? ConfigureActionEntity;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
7
Content.Shared/Speech/ScreamActionEvent.cs
Normal file
7
Content.Shared/Speech/ScreamActionEvent.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
using Content.Shared.Actions;
|
||||
|
||||
namespace Content.Shared.Speech;
|
||||
|
||||
public sealed partial class ScreamActionEvent : InstantActionEvent
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user