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

@@ -82,6 +82,7 @@ namespace Content.Client.Input
human.AddFunction(ContentKeyFunctions.Arcade3);
human.AddFunction(ContentKeyFunctions.LieDown); // WD EDIT
human.AddFunction(ContentKeyFunctions.OfferItem); // WD EDIT
human.AddFunction(ContentKeyFunctions.LookUp); // WD EDIT
// actions should be common (for ghosts, mobs, etc)
common.AddFunction(ContentKeyFunctions.OpenActionsMenu);

View File

@@ -193,6 +193,7 @@ namespace Content.Client.Options.UI.Tabs
AddButton(ContentKeyFunctions.SaveItemLocation);
AddButton(ContentKeyFunctions.OfferItem); // WD EDIT
AddButton(ContentKeyFunctions.LieDown); // WD EDIT
AddButton(ContentKeyFunctions.LookUp); // WD EDIT
AddCheckBox("ui-options-function-auto-get-up", _cfg.GetCVar(WhiteCVars.AutoGetUp), HandleToggleAutoGetUp); // WD EDIT
AddHeader("ui-options-header-interaction-adv");

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