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