mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
28 lines
934 B
C#
28 lines
934 B
C#
using Content.Client.Administration.Managers;
|
|
using Content.Shared.CCVar;
|
|
using Robust.Client;
|
|
using Robust.Client.UserInterface;
|
|
using Robust.Shared.Configuration;
|
|
|
|
namespace Content.Client.DebugMon;
|
|
|
|
/// <summary>
|
|
/// This handles preventing certain debug monitors from being usable by non-admins.
|
|
/// </summary>
|
|
internal sealed partial class DebugMonitorManager
|
|
{
|
|
[Dependency] private IConfigurationManager _cfg = default!;
|
|
[Dependency] private IClientAdminManager _admin = default!;
|
|
[Dependency] private IUserInterfaceManager _userInterface = default!;
|
|
[Dependency] private IBaseClient _baseClient = default!;
|
|
|
|
public void FrameUpdate()
|
|
{
|
|
if (_baseClient.RunLevel == ClientRunLevel.InGame
|
|
&& !_admin.IsActive()
|
|
&& _cfg.GetCVar(CCVars.DebugCoordinatesAdminOnly))
|
|
{
|
|
_userInterface.DebugMonitors.SetMonitor(DebugMonitor.Coords, false);
|
|
}
|
|
}
|
|
}
|