2022-02-26 18:24:08 +13:00
|
|
|
using Content.Shared.Actions;
|
|
|
|
|
using Content.Shared.Actions.ActionTypes;
|
2021-07-12 01:32:10 -07:00
|
|
|
using Robust.Shared.GameStates;
|
2021-01-11 19:24:09 +01:00
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Shared.Clothing
|
2021-01-11 19:24:09 +01:00
|
|
|
{
|
2021-07-12 01:32:10 -07:00
|
|
|
[NetworkedComponent()]
|
2021-11-07 22:17:35 -07:00
|
|
|
public abstract class SharedMagbootsComponent : Component
|
2021-01-11 19:24:09 +01:00
|
|
|
{
|
2022-02-26 18:24:08 +13:00
|
|
|
[DataField("toggleAction", required: true)]
|
|
|
|
|
public InstantAction ToggleAction = new();
|
|
|
|
|
|
2021-01-11 19:24:09 +01:00
|
|
|
public abstract bool On { get; set; }
|
|
|
|
|
|
|
|
|
|
protected void OnChanged()
|
|
|
|
|
{
|
2022-02-26 18:24:08 +13:00
|
|
|
EntitySystem.Get<SharedActionsSystem>().SetToggled(ToggleAction, On);
|
2022-03-13 23:03:49 -07:00
|
|
|
EntitySystem.Get<ClothingSpeedModifierSystem>().SetClothingSpeedModifierEnabled(Owner, On);
|
2021-01-11 19:24:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
public sealed class MagbootsComponentState : ComponentState
|
|
|
|
|
{
|
|
|
|
|
public bool On { get; }
|
|
|
|
|
|
2021-07-12 01:32:10 -07:00
|
|
|
public MagbootsComponentState(bool @on)
|
2021-01-11 19:24:09 +01:00
|
|
|
{
|
|
|
|
|
On = on;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|