Allow zoom command to modify an eye's PVS range (#29245)

Allow zoom command to modify an eye's PVS range

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
Leon Friedrich
2024-08-09 17:26:40 +01:00
committed by deltanedas
co-authored by metalgearsloth
parent 7ca7aacf27
commit 3934fb9603
6 changed files with 50 additions and 8 deletions
@@ -9,7 +9,7 @@ public sealed class ContentEyeSystem : SharedContentEyeSystem
{
[Dependency] private readonly IPlayerManager _player = default!;
public void RequestZoom(EntityUid uid, Vector2 zoom, bool ignoreLimit, ContentEyeComponent? content = null)
public void RequestZoom(EntityUid uid, Vector2 zoom, bool ignoreLimit, bool scalePvs, ContentEyeComponent? content = null)
{
if (!Resolve(uid, ref content, false))
return;
@@ -19,6 +19,14 @@ public sealed class ContentEyeSystem : SharedContentEyeSystem
TargetZoom = zoom,
IgnoreLimit = ignoreLimit,
});
if (scalePvs)
RequestPvsScale(Math.Max(zoom.X, zoom.Y));
}
public void RequestPvsScale(float scale)
{
RaiseNetworkEvent(new RequestPvsScaleEvent(scale));
}
public void RequestToggleFov()