mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-15 14:52:35 +02:00
33 lines
860 B
C#
33 lines
860 B
C#
using JetBrains.Annotations;
|
|
using Robust.Client.Input;
|
|
using Robust.Shared.Console;
|
|
using Robust.Shared.IoC;
|
|
|
|
namespace Robust.Client.Console.Commands
|
|
{
|
|
[UsedImplicitly]
|
|
public sealed class SetInputContextCommand : LocalizedCommands
|
|
{
|
|
public override string Command => "setinputcontext";
|
|
|
|
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
|
{
|
|
if (args.Length != 1)
|
|
{
|
|
shell.WriteLine("Invalid number of arguments!");
|
|
return;
|
|
}
|
|
|
|
var inputMan = IoCManager.Resolve<IInputManager>();
|
|
|
|
if (!inputMan.Contexts.Exists(args[0]))
|
|
{
|
|
shell.WriteLine("Context not found!");
|
|
return;
|
|
}
|
|
|
|
inputMan.Contexts.SetActiveContext(args[0]);
|
|
}
|
|
}
|
|
}
|