Пример #1
0
 public void UnregisterCommand(HaEConsoleCommand command)
 {
     if (commands.ContainsKey(command.Command))
     {
         commands.Remove(command.Command);
     }
 }
Пример #2
0
 public void RegisterCommand(HaEConsoleCommand command)
 {
     if (!commands.ContainsKey(command.Command))
     {
         commands.Add(command.Command, command);
     }
 }
Пример #3
0
        public void BindFromBoundCommand(BoundCommand command)
        {
            if (command.shortKey)
            {
                HaEInputHandler.HaEKeyCombination keyCombination = new HaEInputHandler.HaEKeyCombination(command.key, command.modifier, command.modifier2, HaEConstants.quarterSecTimeOut, command.Execute);
                HaEPluginCore.HaEInputHandler.AddCombination(keyCombination);

                command.keyCombo = keyCombination;
            }
            else
            {
                HaEConsoleCommand consoleCommand = new HaEConsoleCommand(command.bindingName, x => { command.Execute(x); return(""); });
                consoleCommand.hidden = true;
                HaEConsole.Instance.RegisterCommand(consoleCommand);
            }
        }