Add ToggleOutline cvar and console command (#1185)

Co-authored-by: scuffedjays <yetanotherscuffed@gmail.com>
This commit is contained in:
F77F
2020-06-22 14:43:20 -05:00
committed by GitHub
parent afac9e6320
commit f9a60b37ea
3 changed files with 40 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
using Robust.Client.Interfaces.Console;
using Robust.Shared.Interfaces.Configuration;
using Robust.Shared.IoC;
namespace Content.Client.Commands
{
public class ToggleOutlineCommand : IConsoleCommand
{
public string Command => "toggleoutline";
public string Description => "Toggles outline drawing on entities.";
public string Help => "";
public bool Execute(IDebugConsole console, params string[] args)
{
var _configurationManager = IoCManager.Resolve<IConfigurationManager>();
var old = _configurationManager.GetCVar<bool>("outline.enabled");
_configurationManager.SetCVar("outline.enabled", !old);
console.AddLine($"Draw outlines set to: {_configurationManager.GetCVar<bool>("outline.enabled")}");
return false;
}
}
}