2021-12-25 19:53:21 +01:00
|
|
|
using Content.Shared.Administration;
|
2021-06-13 14:52:40 +02:00
|
|
|
using Content.Shared.CCVar;
|
2021-02-11 01:13:03 -08:00
|
|
|
using Robust.Shared.Configuration;
|
2021-02-01 16:49:43 -08:00
|
|
|
using Robust.Shared.Console;
|
2020-06-22 14:43:20 -05:00
|
|
|
using Robust.Shared.IoC;
|
|
|
|
|
|
|
|
|
|
namespace Content.Client.Commands
|
|
|
|
|
{
|
2021-12-25 19:53:21 +01:00
|
|
|
[AnyCommand]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class ToggleOutlineCommand : IConsoleCommand
|
2020-06-22 14:43:20 -05:00
|
|
|
{
|
|
|
|
|
public string Command => "toggleoutline";
|
|
|
|
|
|
|
|
|
|
public string Description => "Toggles outline drawing on entities.";
|
|
|
|
|
|
|
|
|
|
public string Help => "";
|
|
|
|
|
|
2021-02-01 16:49:43 -08:00
|
|
|
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
2020-06-22 14:43:20 -05:00
|
|
|
{
|
2020-11-07 01:15:56 +01:00
|
|
|
var configurationManager = IoCManager.Resolve<IConfigurationManager>();
|
|
|
|
|
var cvar = CCVars.OutlineEnabled;
|
|
|
|
|
var old = configurationManager.GetCVar(cvar);
|
|
|
|
|
|
|
|
|
|
configurationManager.SetCVar(cvar, !old);
|
2021-02-01 16:49:43 -08:00
|
|
|
shell.WriteLine($"Draw outlines set to: {configurationManager.GetCVar(cvar)}");
|
2020-06-22 14:43:20 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|