Refactor actions to be entities with components (#19900)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Content.Shared.Actions;
|
||||
using Content.Shared.Actions.ActionTypes;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Shared.Silicons.Borgs.Components;
|
||||
|
||||
@@ -10,18 +11,13 @@ namespace Content.Shared.Silicons.Borgs.Components;
|
||||
[RegisterComponent, NetworkedComponent, Access(typeof(SharedBorgSystem))]
|
||||
public sealed partial class SelectableBorgModuleComponent : Component
|
||||
{
|
||||
[DataField("moduleSwapAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||
public string? ModuleSwapActionId = "ActionBorgSwapModule";
|
||||
|
||||
/// <summary>
|
||||
/// The sidebar action for swapping to this module.
|
||||
/// </summary>
|
||||
[DataField("moduleSwapAction")]
|
||||
public InstantAction ModuleSwapAction = new()
|
||||
{
|
||||
DisplayName = "action-name-swap-module",
|
||||
Description = "action-desc-swap-module",
|
||||
ItemIconStyle = ItemActionIconStyle.BigItem,
|
||||
Event = new BorgModuleActionSelectedEvent(),
|
||||
UseDelay = TimeSpan.FromSeconds(0.5f)
|
||||
};
|
||||
[DataField("moduleSwapActionEntity")] public EntityUid? ModuleSwapActionEntity;
|
||||
}
|
||||
|
||||
public sealed partial class BorgModuleActionSelectedEvent : InstantActionEvent
|
||||
|
||||
Reference in New Issue
Block a user