Files
wwdpublic/Content.Shared/Item/ItemToggle/Components/ItemToggleSizeComponent.cs
MilenVolf bea2046baf 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>
(cherry picked from commit 1a5f7c39b2a2c244d5d947d8ff8f09250f21450b)
2024-03-07 00:52:34 +01: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;
}