Refactor actions to be entities with components (#19900)
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
using Content.Shared.Actions;
|
||||
using Content.Shared.Actions.ActionTypes;
|
||||
using Content.Shared.Clothing.EntitySystems;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Shared.Clothing.Components;
|
||||
|
||||
@@ -23,14 +24,13 @@ public sealed partial class StealthClothingComponent : Component
|
||||
[DataField("visibility"), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
||||
public float Visibility;
|
||||
|
||||
[DataField("toggleAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||
public string ToggleAction = "ActionTogglePhaseCloak";
|
||||
|
||||
/// <summary>
|
||||
/// The action for enabling and disabling stealth.
|
||||
/// </summary>
|
||||
[DataField("toggleAction")]
|
||||
public InstantAction ToggleAction = new()
|
||||
{
|
||||
Event = new ToggleStealthEvent()
|
||||
};
|
||||
[DataField("toggleActionEntity")] public EntityUid? ToggleActionEntity;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using Content.Shared.Actions.ActionTypes;
|
||||
using Content.Shared.Clothing.EntitySystems;
|
||||
using Content.Shared.Inventory;
|
||||
using Robust.Shared.Containers;
|
||||
@@ -20,9 +19,11 @@ public sealed partial class ToggleableClothingComponent : Component
|
||||
/// <summary>
|
||||
/// Action used to toggle the clothing on or off.
|
||||
/// </summary>
|
||||
[DataField("actionId", customTypeSerializer: typeof(PrototypeIdSerializer<InstantActionPrototype>))]
|
||||
public string ActionId = "ToggleSuitPiece";
|
||||
public InstantAction? ToggleAction = null;
|
||||
[DataField("action", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||
public string Action = "ActionToggleSuitPiece";
|
||||
|
||||
[DataField("actionEntity")]
|
||||
public EntityUid? ActionEntity;
|
||||
|
||||
/// <summary>
|
||||
/// Default clothing entity prototype to spawn into the clothing container.
|
||||
@@ -66,7 +67,7 @@ public sealed partial class ToggleableClothingComponent : Component
|
||||
public TimeSpan? StripDelay = TimeSpan.FromSeconds(3);
|
||||
|
||||
/// <summary>
|
||||
/// Text shown in the toggle-clothing verb. Defaults to using the name of the <see cref="ToggleAction"/> action.
|
||||
/// Text shown in the toggle-clothing verb. Defaults to using the name of the <see cref="ActionEntity"/> action.
|
||||
/// </summary>
|
||||
[DataField("verbText")]
|
||||
public string? VerbText;
|
||||
|
||||
Reference in New Issue
Block a user