Allow zoom command to ignore zoom limits (#19419)

This commit is contained in:
Leon Friedrich
2023-08-22 21:27:41 +12:00
committed by GitHub
parent cf38f16d36
commit 4d845caa07
7 changed files with 62 additions and 36 deletions

View File

@@ -4,6 +4,7 @@ using Robust.Client.Console;
using Robust.Client.Player;
using Robust.Shared.ContentPack;
using Robust.Shared.Network;
using Robust.Shared.Players;
using Robust.Shared.Utility;
namespace Content.Client.Administration.Managers
@@ -121,5 +122,13 @@ namespace Content.Client.Administration.Managers
? _adminData
: null;
}
public AdminData? GetAdminData(ICommonSession session, bool includeDeAdmin = false)
{
if (_player.LocalPlayer?.UserId == session.UserId)
return _adminData;
return null;
}
}
}

View File

@@ -64,7 +64,7 @@ public sealed class ZoomCommand : IConsoleCommand
if (_entManager.TryGetComponent<ContentEyeComponent>(player, out var content))
{
_entManager.System<ContentEyeSystem>().RequestZoom(player.Value, zoom, content);
_entManager.System<ContentEyeSystem>().RequestZoom(player.Value, zoom, true, content);
return;
}

View File

@@ -10,7 +10,7 @@ public sealed class ContentEyeSystem : SharedContentEyeSystem
{
[Dependency] private readonly IPlayerManager _player = default!;
public void RequestZoom(EntityUid uid, Vector2 zoom, ContentEyeComponent? content = null)
public void RequestZoom(EntityUid uid, Vector2 zoom, bool ignoreLimit, ContentEyeComponent? content = null)
{
if (!Resolve(uid, ref content, false))
return;
@@ -18,6 +18,7 @@ public sealed class ContentEyeSystem : SharedContentEyeSystem
RaisePredictiveEvent(new RequestTargetZoomEvent()
{
TargetZoom = zoom,
IgnoreLimit = ignoreLimit,
});
}