| 1234567891011121314151617181920212223242526272829303132 |
- using Content.Shared.Item.ItemToggle;
- using Robust.Shared.GameStates;
- using Robust.Shared.Prototypes;
- namespace Content.Shared.Item.ItemToggle.Components;
- /// <summary>
- /// Adds or removes components when toggled.
- /// Requires <see cref="ItemToggleComponent"/>.
- /// </summary>
- [RegisterComponent, NetworkedComponent, Access(typeof(ComponentTogglerSystem))]
- public sealed partial class ComponentTogglerComponent : Component
- {
- /// <summary>
- /// The components to add when activated.
- /// </summary>
- [DataField(required: true)]
- public ComponentRegistry Components = new();
- /// <summary>
- /// The components to remove when deactivated.
- /// If this is null <see cref="Components"/> is reused.
- /// </summary>
- [DataField]
- public ComponentRegistry? RemoveComponents;
- /// <summary>
- /// If true, adds components on the entity's parent instead of the entity itself.
- /// </summary>
- [DataField]
- public bool Parent;
- }
|