public static void RegisterKeys()
        {
            HaEInputHandler.HaEKeyCombination enter = new HaEInputHandler.HaEKeyCombination(VRage.Input.MyKeys.Enter, VRage.Input.MyKeys.None, VRage.Input.MyKeys.None, HaEConstants.quarterSecTimeOut, HandleEnter);
            HaEPluginCore.HaEInputHandler.AddCombination(enter);

            HaEInputHandler.HaEKeyCombination back = new HaEInputHandler.HaEKeyCombination(VRage.Input.MyKeys.Up, VRage.Input.MyKeys.None, VRage.Input.MyKeys.None, HaEConstants.quarterSecTimeOut, HandlePrevious);
            HaEPluginCore.HaEInputHandler.AddCombination(back);
        }
예제 #2
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);
            }
        }
예제 #3
0
        public void Init(object gameInstance)
        {
            _instance = this;

            HaEInputHandler.HaEKeyCombination enter = new HaEInputHandler.HaEKeyCombination(VRage.Input.MyKeys.C, VRage.Input.MyKeys.RightAlt, VRage.Input.MyKeys.None, HaEConstants.quarterSecTimeOut, HaEConsoleScreen.Show);
            HaEPluginCore.HaEInputHandler.AddCombination(enter);

            HaEInputHandler.HaEKeyCombination exit = new HaEInputHandler.HaEKeyCombination(VRage.Input.MyKeys.Escape, VRage.Input.MyKeys.None, VRage.Input.MyKeys.None, HaEConstants.quarterSecTimeOut, HaEConsoleScreen.Close);
            HaEPluginCore.HaEInputHandler.AddCombination(exit);

            _displayScreen  = new StringBuilder();
            _commandHistory = new LinkedList <string>();
            commands        = new Dictionary <string, HaEConsoleCommand>();

            commandBinder = new HaEConsoleCommandBinder();

            HaEConsoleScreen.RegisterKeys();
            HaEConsoleDefaultCommands.RegisterCommands();
        }