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

@@ -0,0 +1,32 @@
using System.Numerics;
using Content.Shared.Movement.Systems;
using Robust.Shared.GameStates;
namespace Content.Shared.Movement.Components;
/// <summary>
/// Displaces SS14 eye data when given to an entity.
/// </summary>
[ComponentProtoName("EyeCursorOffset"), NetworkedComponent]
public abstract partial class SharedEyeCursorOffsetComponent : Component
{
/// <summary>
/// The amount the view will be displaced when the cursor is positioned at/beyond the max offset distance.
/// Measured in tiles.
/// </summary>
[DataField]
public float MaxOffset = 3f;
/// <summary>
/// The speed which the camera adjusts to new positions. 0.5f seems like a good value, but can be changed if you want very slow/instant adjustments.
/// </summary>
[DataField]
public float OffsetSpeed = 0.5f;
/// <summary>
/// The amount the PVS should increase to account for the max offset.
/// Should be 1/10 of MaxOffset most of the time.
/// </summary>
[DataField]
public float PvsIncrease = 0.3f;
}