Refactor actions to be entities with components (#19900)

This commit is contained in:
DrSmugleaf
2023-09-08 18:16:05 -07:00
committed by GitHub
parent e18f731b91
commit c71f97e3a2
210 changed files with 10693 additions and 11714 deletions

View File

@@ -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>

View File

@@ -0,0 +1,7 @@
using Content.Shared.Actions;
namespace Content.Shared.Speech;
public sealed partial class ScreamActionEvent : InstantActionEvent
{
}