CatStation/Content.Client/DebugMon/DebugMonitorManager.cs
Pieter-Jan Briers 5168b5f3d4
IoC source gen compatibility (#43863)
* 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
2026-05-09 03:29:58 +00:00

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);
}
}
}