Files
wwdpublic/Content.Client/DebugMon/DebugMonitorSystem.cs
Kot df3e231c16 Fix admins unable to hide the coordinates debug monitor (#24084)
Allow admins to hide the coords monitor

(cherry picked from commit 620074ab0ac9261d6c7f67f7944658575115a12d)
2024-01-26 22:50:09 +01:00

24 lines
795 B
C#

using Content.Client.Administration.Managers;
using Content.Shared.CCVar;
using Robust.Client.UserInterface;
using Robust.Shared.Configuration;
namespace Content.Client.DebugMon;
/// <summary>
/// This handles preventing certain debug monitors from appearing.
/// </summary>
public sealed class DebugMonitorSystem : EntitySystem
{
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IClientAdminManager _admin = default!;
[Dependency] private readonly IUserInterfaceManager _userInterface = default!;
public override void FrameUpdate(float frameTime)
{
if (!_admin.IsActive() && _cfg.GetCVar(CCVars.DebugCoordinatesAdminOnly))
_userInterface.DebugMonitors.SetMonitor(DebugMonitor.Coords, false);
}
}