Revert "Actions Rework" (#6888)
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using Content.Shared.Actions;
|
||||
using Content.Shared.Actions.Behaviors.Item;
|
||||
using Content.Shared.Actions.Components;
|
||||
using Content.Shared.Clothing;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Inventory;
|
||||
@@ -36,6 +38,8 @@ namespace Content.Server.Clothing.Components
|
||||
EntitySystem.Get<MagbootsSystem>().UpdateMagbootEffects(container.Owner, Owner, true, this);
|
||||
}
|
||||
|
||||
if(_entMan.TryGetComponent<ItemActionsComponent>(Owner, out var itemActions))
|
||||
itemActions.Toggle(ItemActionType.ToggleMagboots, On);
|
||||
if (_entMan.TryGetComponent<SharedItemComponent>(Owner, out var item))
|
||||
item.EquippedPrefix = On ? "on" : null;
|
||||
if(_entMan.TryGetComponent<SpriteComponent>(Owner, out var sprite))
|
||||
@@ -45,14 +49,33 @@ namespace Content.Server.Clothing.Components
|
||||
}
|
||||
}
|
||||
|
||||
void IActivate.Activate(ActivateEventArgs eventArgs)
|
||||
public void Toggle(EntityUid user)
|
||||
{
|
||||
On = !On;
|
||||
}
|
||||
|
||||
void IActivate.Activate(ActivateEventArgs eventArgs)
|
||||
{
|
||||
Toggle(eventArgs.User);
|
||||
}
|
||||
|
||||
public override ComponentState GetComponentState()
|
||||
{
|
||||
return new MagbootsComponentState(On);
|
||||
}
|
||||
}
|
||||
|
||||
[UsedImplicitly]
|
||||
[DataDefinition]
|
||||
public sealed class ToggleMagbootsAction : IToggleItemAction
|
||||
{
|
||||
public bool DoToggleAction(ToggleItemActionEventArgs args)
|
||||
{
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<MagbootsComponent?>(args.Item, out var magboots))
|
||||
return false;
|
||||
|
||||
magboots.Toggle(args.Performer);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user