mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-01 00:27:59 +00:00
52 lines
1.6 KiB
C#
52 lines
1.6 KiB
C#
using Content.Server.Movement.Components;
|
|
using Content.Shared._DV.Movement;
|
|
using Content.Shared.Actions;
|
|
using Content.Shared.Movement.Systems;
|
|
|
|
namespace Content.Server._DV.Movement;
|
|
|
|
public sealed class CursorOffsetActionSystem : SharedCursorOffsetActionSystem
|
|
{
|
|
[Dependency] private readonly SharedActionsSystem _actions = default!;
|
|
[Dependency] private readonly SharedContentEyeSystem _eye = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
//SubscribeLocalEvent<CursorOffsetActionComponent, ComponentInit>(OnInit);
|
|
//SubscribeLocalEvent<CursorOffsetActionComponent, CursorOffsetActionEvent>(OnAction);
|
|
}
|
|
|
|
private void OnInit(Entity<CursorOffsetActionComponent> ent, ref ComponentInit args)
|
|
{
|
|
_actions.AddAction(ent, ref ent.Comp.CursorOffsetActionEntity, ent.Comp.CursorOffsetActionId );
|
|
|
|
if (_actions.GetAction(ent.Comp.CursorOffsetActionEntity) is not { Comp.UseDelay: not null })
|
|
{
|
|
_actions.StartUseDelay(ent.Comp.CursorOffsetActionEntity);
|
|
}
|
|
}
|
|
|
|
protected override void OnAction(Entity<CursorOffsetActionComponent> ent, ref CursorOffsetActionEvent args)
|
|
{
|
|
base.OnAction(ent, ref args);
|
|
|
|
Log.Info("okay running the server code now trust (just pvsscale)");
|
|
|
|
_eye.UpdatePvsScale(args.Performer);
|
|
}
|
|
|
|
public override void AddOrRemoveEyeOffset(Entity<CursorOffsetActionComponent> ent, bool add)
|
|
{
|
|
if (add)
|
|
{
|
|
AddComp<EyeCursorOffsetComponent>(ent);
|
|
}
|
|
else
|
|
{
|
|
RemComp<EyeCursorOffsetComponent>(ent);
|
|
}
|
|
}
|
|
}
|