Exemplo n.º 1
0
        public MyMichalDebugInputComponent()
        {
            Static = this;

            Axes           = new List <MyJoystickAxesEnum>();
            AxesCollection = new Dictionary <MyJoystickAxesEnum, float?>();
            foreach (var axis in Enum.GetValues(typeof(MyJoystickAxesEnum)))
            {
                MyJoystickAxesEnum val = (MyJoystickAxesEnum)axis;
                AxesCollection[val] = null;
                Axes.Add(val);
            }

            AddShortcut(MyKeys.NumPad0, true, false, false, false, () => "Debug draw", DebugDrawFunc);

            if (MyPerGameSettings.Game == GameEnum.SE_GAME)
            {
                AddShortcut(MyKeys.NumPad1, true, false, false, false, () => "Remove grids with space balls", RemoveGridsWithSpaceBallsFunc);
                AddShortcut(MyKeys.NumPad2, true, false, false, false, () => "Throw 50 ores and 50 scrap metals", ThrowFloatingObjectsFunc);
            }

            if (MyPerGameSettings.EnableAi)
            {
                AddShortcut(MyKeys.NumPad6, true, false, false, false, () => "Next head matrix", NextHeadMatrix);
                AddShortcut(MyKeys.NumPad5, true, false, false, false, () => "Previous head matrix", PreviousHeadMatrix);
                AddShortcut(MyKeys.NumPad3, true, false, false, false, OnSelectBotForDebugMsg, () => { OnSelectDebugBot = !OnSelectDebugBot; return(true); });
                AddShortcut(MyKeys.NumPad4, true, false, false, false, () => "Remove bot", () => { MyAIComponent.Static.DebugRemoveFirstBot(); return(true); });
                AddShortcut(MyKeys.NumPad7, true, false, false, false, () => { return("DEBUG ANIMALS " + (MyDebugDrawSettings.DEBUG_DRAW_ANIMALS ? "TRUE" : "FALSE")); }, () => { MyDebugDrawSettings.DEBUG_DRAW_ANIMALS = !MyDebugDrawSettings.DEBUG_DRAW_ANIMALS; return(true); });
            }
        }
        public MyMichalDebugInputComponent()
        {
            Static = this;

            Axes = new List<MyJoystickAxesEnum>();
            AxesCollection = new Dictionary<MyJoystickAxesEnum, float?>();
            foreach (var axis in Enum.GetValues(typeof(MyJoystickAxesEnum)))
            {
                MyJoystickAxesEnum val = (MyJoystickAxesEnum)axis;
                AxesCollection[val] = null;
                Axes.Add(val);
            }

            AddShortcut(MyKeys.NumPad7, true, false, false, false, () => "Enable LMB spawning: " + ENABLE_FLORA_SPAWNING, () => { ENABLE_FLORA_SPAWNING = !ENABLE_FLORA_SPAWNING; return true; });
            AddShortcut(MyKeys.NumPad8, true, false, false, false, () => "Select flora to spawn. Selected: " + SELECTED_FLORA, SelectNextFloraToSpawn);

            AddShortcut(MyKeys.NumPad0, true, false, false, false, () => "Debug draw", DebugDrawFunc);

            AddShortcut(MyKeys.NumPad9, true, false, false, false, OnRecording, ToggleVoiceChat);

            if (MyPerGameSettings.Game == GameEnum.SE_GAME)
            {
                AddShortcut(MyKeys.NumPad1, true, false, false, false, () => "Remove grids with space balls", RemoveGridsWithSpaceBallsFunc);
                AddShortcut(MyKeys.NumPad2, true, false, false, false, () => "Throw 50 ores and 50 scrap metals", ThrowFloatingObjectsFunc);
            }

            if (MyPerGameSettings.EnableAi)
            {
                AddShortcut(MyKeys.NumPad6, true, false, false, false, () => "Next head matrix", NextHeadMatrix);
                AddShortcut(MyKeys.NumPad5, true, false, false, false, () => "Previous head matrix", PreviousHeadMatrix);
                AddShortcut(MyKeys.NumPad3, true, false, false, false, OnSelectBotForDebugMsg, () => { OnSelectDebugBot = !OnSelectDebugBot; return true; });
                AddShortcut(MyKeys.NumPad4, true, false, false, false, () => "Remove bot", () => { MyAIComponent.Static.DebugRemoveFirstBot(); return true; });
           //     AddShortcut(MyKeys.NumPad7, true, false, false, false, () => { return "DEBUG ANIMALS " + (MyDebugDrawSettings.DEBUG_DRAW_ANIMALS ? "TRUE" : "FALSE"); }, () => { MyDebugDrawSettings.DEBUG_DRAW_ANIMALS = !MyDebugDrawSettings.DEBUG_DRAW_ANIMALS; return true; });
            }
        }
Exemplo n.º 3
0
        public MyMichalDebugInputComponent()
        {
            Static = this;

            Axes           = new List <MyJoystickAxesEnum>();
            AxesCollection = new Dictionary <MyJoystickAxesEnum, float?>();
            foreach (var axis in Enum.GetValues(typeof(MyJoystickAxesEnum)))
            {
                MyJoystickAxesEnum val = (MyJoystickAxesEnum)axis;
                AxesCollection[val] = null;
                Axes.Add(val);
            }

            AddShortcut(MyKeys.NumPad7, true, false, false, false, () => "Enable LMB spawning: " + ENABLE_FLORA_SPAWNING, () => { ENABLE_FLORA_SPAWNING = !ENABLE_FLORA_SPAWNING; return(true); });
            AddShortcut(MyKeys.NumPad8, true, false, false, false, () => "Select flora to spawn. Selected: " + SELECTED_FLORA, SelectNextFloraToSpawn);

            AddShortcut(MyKeys.NumPad0, true, false, false, false, () => "Debug draw", DebugDrawFunc);

            AddShortcut(MyKeys.NumPad9, true, false, false, false, OnRecording, ToggleVoiceChat);

            if (MyPerGameSettings.Game == GameEnum.SE_GAME)
            {
                AddShortcut(MyKeys.NumPad1, true, false, false, false, () => "Remove grids with space balls", RemoveGridsWithSpaceBallsFunc);
                AddShortcut(MyKeys.NumPad2, true, false, false, false, () => "Throw 50 ores and 50 scrap metals", ThrowFloatingObjectsFunc);
            }

            if (MyPerGameSettings.EnableAi)
            {
                AddShortcut(MyKeys.NumPad6, true, false, false, false, () => "Next head matrix", NextHeadMatrix);
                AddShortcut(MyKeys.NumPad5, true, false, false, false, () => "Previous head matrix", PreviousHeadMatrix);
                AddShortcut(MyKeys.NumPad3, true, false, false, false, OnSelectBotForDebugMsg, () => { OnSelectDebugBot = !OnSelectDebugBot; return(true); });
                AddShortcut(MyKeys.NumPad4, true, false, false, false, () => "Remove bot", () => { MyAIComponent.Static.DebugRemoveFirstBot(); return(true); });
                AddShortcut(MyKeys.L, true, true, false, false, () => "Add animal bot", SpawnAnimalAroundPlayer);
                AddShortcut(MyKeys.OemSemicolon, true, true, false, false, () => "Spawn selected bot " + (m_selectBotName != null ? m_selectBotName : "NOT SELECTED"), SpawnBot);
                AddShortcut(MyKeys.OemMinus, true, true, false, false, () => "Previous bot definition", PreviousBot);
                AddShortcut(MyKeys.OemPlus, true, true, false, false, () => "Next bot definition", NextBot);
                AddShortcut(MyKeys.OemQuotes, true, true, false, false, () => "Reload bot definitions", ReloadDefinitions);
                AddShortcut(MyKeys.OemComma, true, true, false, false, () => "RemoveAllTimbers", RemoveAllTimbers);
                AddShortcut(MyKeys.N, true, true, false, false, () => "Cast long ray", ChangeAlgo);
                //     AddShortcut(MyKeys.NumPad7, true, false, false, false, () => { return "DEBUG ANIMALS " + (MyDebugDrawSettings.DEBUG_DRAW_ANIMALS ? "TRUE" : "FALSE"); }, () => { MyDebugDrawSettings.DEBUG_DRAW_ANIMALS = !MyDebugDrawSettings.DEBUG_DRAW_ANIMALS; return true; });
            }
        }