Add ToggleOutline cvar and console command (#1185)
Co-authored-by: scuffedjays <yetanotherscuffed@gmail.com>
This commit is contained in:
24
Content.Client/Commands/ToggleOutlineCommand.cs
Normal file
24
Content.Client/Commands/ToggleOutlineCommand.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user