Files
tbd-station-14/Content.Shared/Item/ItemToggle/Components/ItemToggleSizeComponent.cs
MilenVolf 1a5f7c39b2 Toggleable items shape change on toggle state (#25392)
* Toggleable items now can change their shape depends on toggle state

* Update Content.Shared/Item/SharedItemSystem.cs

---------

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2024-02-26 00:20:28 +11:00

39 lines
1.3 KiB
C#

using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Shared.Item.ItemToggle.Components;
/// <summary>
/// Handles the changes to the item size when toggled.
/// </summary>
/// <remarks>
/// You can change the size when activated or not. By default the sizes are copied from the item.
/// </remarks>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class ItemToggleSizeComponent : Component
{
/// <summary>
/// Item's size when activated
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
public ProtoId<ItemSizePrototype>? ActivatedSize = null;
/// <summary>
/// Item's shape when activated
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField]
public List<Box2i>? ActivatedShape = null;
/// <summary>
/// Item's size when deactivated. If none is mentioned, it uses the item's default size instead.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
public ProtoId<ItemSizePrototype>? DeactivatedSize = null;
/// <summary>
/// Item's shape when deactivated. If none is mentioned, it uses the item's default shape instead.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField]
public List<Box2i>? DeactivatedShape = null;
}