CatStation/Content.Client/Commands/ToggleOutlineCommand.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

25 lines
876 B
C#

using Content.Shared.Administration;
using Content.Shared.CCVar;
using Robust.Shared.Configuration;
using Robust.Shared.Console;
namespace Content.Client.Commands;
[AnyCommand]
public sealed partial class ToggleOutlineCommand : LocalizedCommands
{
[Dependency] private IConfigurationManager _configurationManager = default!;
public override string Command => "toggleoutline";
public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
var cvar = CCVars.OutlineEnabled;
var old = _configurationManager.GetCVar(cvar);
_configurationManager.SetCVar(cvar, !old);
shell.WriteLine(LocalizationManager.GetString($"cmd-{Command}-notify", ("state", _configurationManager.GetCVar(cvar))));
}
}