2022-02-26 18:24:08 +13:00
|
|
|
using Robust.Shared.GameStates;
|
|
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.Actions;
|
|
|
|
|
|
|
|
|
|
[NetworkedComponent]
|
|
|
|
|
[RegisterComponent]
|
2022-06-07 15:26:28 +02:00
|
|
|
[Access(typeof(SharedActionsSystem))]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class ActionsComponent : Component
|
2022-02-26 18:24:08 +13:00
|
|
|
{
|
2023-09-08 18:16:05 -07:00
|
|
|
/// <summary>
|
2023-09-23 04:49:39 -04:00
|
|
|
/// List of actions currently granted to this entity.
|
|
|
|
|
/// On the client, this may contain a mixture of client-side and networked entities.
|
2023-09-08 18:16:05 -07:00
|
|
|
/// </summary>
|
2023-09-23 04:49:39 -04:00
|
|
|
[DataField] public HashSet<EntityUid> Actions = new();
|
2022-02-26 18:24:08 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
public sealed class ActionsComponentState : ComponentState
|
|
|
|
|
{
|
2023-09-11 09:42:41 +10:00
|
|
|
public readonly HashSet<NetEntity> Actions;
|
2022-02-26 18:24:08 +13:00
|
|
|
|
2023-09-11 09:42:41 +10:00
|
|
|
public ActionsComponentState(HashSet<NetEntity> actions)
|
2022-02-26 18:24:08 +13:00
|
|
|
{
|
|
|
|
|
Actions = actions;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Determines how the action icon appears in the hotbar for item actions.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public enum ItemActionIconStyle : byte
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The default - The item icon will be big with a small action icon in the corner
|
|
|
|
|
/// </summary>
|
|
|
|
|
BigItem,
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The action icon will be big with a small item icon in the corner
|
|
|
|
|
/// </summary>
|
|
|
|
|
BigAction,
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// BigAction but no item icon will be shown in the corner.
|
|
|
|
|
/// </summary>
|
|
|
|
|
NoItem
|
|
|
|
|
}
|