using Content.Shared.Actions; namespace Content.Shared._DV.Movement; public abstract class SharedCursorOffsetActionSystem : EntitySystem { [Dependency] private readonly SharedActionsSystem _actions = default!; public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnInit); SubscribeLocalEvent(OnRemove); SubscribeLocalEvent(OnAction); } protected virtual void OnInit(Entity ent, ref ComponentInit args) { _actions.AddAction(ent, ref ent.Comp.CursorOffsetActionEntity, ent.Comp.CursorOffsetActionId); } private void OnRemove(Entity ent, ref ComponentRemove args) { _actions.RemoveAction(ent.Owner, ent.Comp.CursorOffsetActionEntity); } protected virtual void OnAction(Entity ent, ref CursorOffsetActionEvent args) { if (args.Handled) return; ent.Comp.Active = !ent.Comp.Active; Dirty(ent); args.Handled = true; } }