Example #1
0
        protected override void Update(GameTime time)
        {
            debugKeyboardManager.Update(time);
            if (!consoleControl.Focused)
            {
                updateContainer.Update(time);
            }
            if (updateContainer.Keyboard.IsKeyPressed(Keys.F))
            {
                ConsoleCommands.FreezeGame = !ConsoleCommands.FreezeGame;
            }
            if (updateContainer.Keyboard.IsKeyPressed(Keys.L))
            {
                ConsoleCommands.PlayLoop = !ConsoleCommands.PlayLoop;
            }
            if (debugKeyboardManager.IsCtrlKeyPressed(Keys.C) ||
                (!consoleControl.Focused && debugKeyboardManager.IsCharPressed('/')))
            {
                if (consoleControl.Focused)
                {
                    consoleControl.Unfocus();
                }
                else
                {
                    consoleControl.Focus();
                }
            }
            IsMouseVisible = false;
            debugKeyboardManager.EndUpdate();
            updateContainer.EndUpdate();
            consoleControl.Update(time, debugKeyboardManager);

            if (ConsoleCommands.FreezeGame)
            {
                IsMouseVisible = true;
                return;
            }


            phaseManager.Update(updateContainer);

            base.Update(time);
        }