Add conditional camera offset based on cursor - Hristov Rework, Part 1 (#31626)

This commit is contained in:
SlamBamActionman
2025-01-28 00:20:45 +01:00
committed by GitHub
parent 3e091c4dfa
commit 5c782d3028
20 changed files with 357 additions and 12 deletions

View File

@@ -1,4 +1,6 @@
using System.Numerics;
using Content.Shared.Movement.Components;
using Content.Shared.Movement.Systems;
using JetBrains.Annotations;
using Robust.Shared.Network;
using Robust.Shared.Serialization;
@@ -28,7 +30,7 @@ public abstract class SharedCameraRecoilSystem : EntitySystem
/// </summary>
protected const float KickMagnitudeMax = 1f;
[Dependency] private readonly SharedEyeSystem _eye = default!;
[Dependency] private readonly SharedContentEyeSystem _eye = default!;
[Dependency] private readonly INetManager _net = default!;
public override void Initialize()
@@ -81,9 +83,7 @@ public abstract class SharedCameraRecoilSystem : EntitySystem
continue;
recoil.LastKick = recoil.CurrentKick;
var ev = new GetEyeOffsetEvent();
RaiseLocalEvent(uid, ref ev);
_eye.SetOffset(uid, ev.Offset, eye);
_eye.UpdateEyeOffset((uid, eye));
}
}