Revert "Actions Rework" (#6888)
This commit is contained in:
@@ -1,24 +1,22 @@
|
||||
using Content.Shared.Actions;
|
||||
using Content.Shared.Actions.ActionTypes;
|
||||
using System;
|
||||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Movement.EntitySystems;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Shared.Clothing
|
||||
{
|
||||
[NetworkedComponent()]
|
||||
public abstract class SharedMagbootsComponent : Component
|
||||
{
|
||||
[DataField("toggleAction", required: true)]
|
||||
public InstantAction ToggleAction = default!;
|
||||
|
||||
public abstract bool On { get; set; }
|
||||
|
||||
protected void OnChanged()
|
||||
{
|
||||
EntitySystem.Get<SharedActionsSystem>().SetToggled(ToggleAction, On);
|
||||
|
||||
// inventory system will automatically hook into the event raised by this and update accordingly
|
||||
if (Owner.TryGetContainer(out var container))
|
||||
{
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
using Content.Shared.Actions;
|
||||
using Content.Shared.Toggleable;
|
||||
|
||||
namespace Content.Shared.Clothing;
|
||||
|
||||
public abstract class SharedMagbootsSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<SharedMagbootsComponent, GetActionsEvent>(OnGetActions);
|
||||
SubscribeLocalEvent<SharedMagbootsComponent, ToggleActionEvent>(OnToggleAction);
|
||||
}
|
||||
|
||||
private void OnGetActions(EntityUid uid, SharedMagbootsComponent component, GetActionsEvent args)
|
||||
{
|
||||
args.Actions.Add(component.ToggleAction);
|
||||
}
|
||||
|
||||
private void OnToggleAction(EntityUid uid, SharedMagbootsComponent component, ToggleActionEvent args)
|
||||
{
|
||||
if (args.Handled)
|
||||
return;
|
||||
|
||||
component.On = !component.On;
|
||||
|
||||
args.Handled = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user