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
|
|
|
|
2024-01-03 23:29:37 +01:00
|
|
|
namespace Content.Client.Commands;
|
|
|
|
|
|
|
|
|
|
[AnyCommand]
|
|
|
|
|
public sealed class ToggleOutlineCommand : LocalizedCommands
|
2020-06-22 14:43:20 -05:00
|
|
|
{
|
2024-01-03 23:29:37 +01:00
|
|
|
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
|
2020-06-22 14:43:20 -05:00
|
|
|
|
2024-01-03 23:29:37 +01:00
|
|
|
public override string Command => "toggleoutline";
|
2020-06-22 14:43:20 -05:00
|
|
|
|
2024-01-03 23:29:37 +01:00
|
|
|
public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));
|
2020-06-22 14:43:20 -05:00
|
|
|
|
2024-01-03 23:29:37 +01:00
|
|
|
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
|
|
|
|
{
|
|
|
|
|
var cvar = CCVars.OutlineEnabled;
|
|
|
|
|
var old = _configurationManager.GetCVar(cvar);
|
2020-11-07 01:15:56 +01:00
|
|
|
|
2024-01-03 23:29:37 +01:00
|
|
|
_configurationManager.SetCVar(cvar, !old);
|
|
|
|
|
shell.WriteLine(LocalizationManager.GetString($"cmd-{Command}-notify", ("state", _configurationManager.GetCVar(cvar))));
|
2020-06-22 14:43:20 -05:00
|
|
|
}
|
|
|
|
|
}
|