add hrp ++++ aspect (#587)
This commit is contained in:
@@ -2,6 +2,7 @@ using System.Numerics;
|
||||
using Content.Client.Viewport;
|
||||
using Content.Shared._White.Telescope;
|
||||
using Content.Shared.Hands.Components;
|
||||
using Content.Shared.Input;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Input;
|
||||
@@ -23,6 +24,7 @@ public sealed class TelescopeSystem : SharedTelescopeSystem
|
||||
|
||||
private ScalingViewport? _viewport;
|
||||
|
||||
|
||||
public override void FrameUpdate(float frameTime)
|
||||
{
|
||||
base.FrameUpdate(frameTime);
|
||||
@@ -32,19 +34,25 @@ public sealed class TelescopeSystem : SharedTelescopeSystem
|
||||
|
||||
var player = _player.LocalEntity;
|
||||
|
||||
if (!TryComp<HandsComponent>(player, out var hands) ||
|
||||
!TryComp<TelescopeComponent>(hands.ActiveHandEntity, out var telescope) ||
|
||||
!TryComp<EyeComponent>(player.Value, out var eye))
|
||||
var entity = GetRightEntity(player);
|
||||
|
||||
if (entity == EntityUid.Invalid)
|
||||
return;
|
||||
|
||||
var telescope = Comp<TelescopeComponent>(entity);
|
||||
|
||||
if (!TryComp<EyeComponent>(player, out var eye))
|
||||
return;
|
||||
|
||||
var offset = Vector2.Zero;
|
||||
|
||||
if (_inputSystem.CmdStates.GetState(EngineKeyFunctions.UseSecondary) != BoundKeyState.Down)
|
||||
if (_inputSystem.CmdStates.GetState(ContentKeyFunctions.LookUp) != BoundKeyState.Down)
|
||||
{
|
||||
RaisePredictiveEvent(new EyeOffsetChangedEvent
|
||||
{
|
||||
Offset = offset
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user