add hrp ++++ aspect (#587)

This commit is contained in:
ThereDrD
2024-08-08 21:05:25 +03:00
committed by GitHub
parent 48c86bd846
commit a6a69cc60f
10 changed files with 185 additions and 10 deletions

View File

@@ -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;
}