Пример #1
0
        public void loadContent()
        {
            inputHandler = new ThirdPersonInputHandler();
            inputHandler.selectedBlockType = 7;
            oldMouseState = Mouse.GetState();

            inputHandler.openMainMenu();
        }
Пример #2
0
        public static List <ConsoleAction> update(Vector3 playerLocation)
        {
            KeyboardState newKeyboardState = Keyboard.GetState();

            if (!active)
            {
                if (PlayerInputHandler.justHit(consoleOpenkey, newKeyboardState, oldKeyboardState))
                {
                    active = true;
                }

                if (!currentText.Equals(""))
                {
                    currentText = "";
                }
                oldKeyboardState = newKeyboardState;
                return(new List <ConsoleAction>());
            }
            else if (PlayerInputHandler.justHit(consoleOpenkey, newKeyboardState, oldKeyboardState))
            {
                active           = false;
                oldKeyboardState = newKeyboardState;
                return(new List <ConsoleAction>());
            }


            for (int i = 0; i < letters.Length; i++)
            {
                if (PlayerInputHandler.justHit(letters[i], newKeyboardState, oldKeyboardState))
                {
                    currentText += chars[i];
                }
            }

            if (PlayerInputHandler.justHit(Keys.Back, newKeyboardState, oldKeyboardState))
            {
                if (currentText.Length > 0)
                {
                    currentText = currentText.Substring(0, currentText.Length - 1);
                }
            }

            if (PlayerInputHandler.justHit(Keys.Enter, newKeyboardState, oldKeyboardState))
            {
                oldKeyboardState = newKeyboardState;
                history.Add(currentText);

                List <ConsoleAction> result = getActionsFromCurrentString(playerLocation);
                currentText = "";
                closeConsole();
                return(result);
            }

            oldKeyboardState = newKeyboardState;

            return(new List <ConsoleAction>());
        }
Пример #3
0
        public void disembodyCharacter()
        {
            embodying = false;
            selectedCharacter.setIsWalkingOverride(false);
            setCameraLoc(selectedCharacter.getFootLocation() + new Vector3(0, 10, 0));

            byte oldSelectedBlock = inputHandler.selectedBlockType;

            inputHandler = new ThirdPersonInputHandler();
            inputHandler.selectedBlockType = oldSelectedBlock;
        }
Пример #4
0
 public void embodyCharacter(Character nEmbodied)
 {
     if (hasCommandOverCharacter(nEmbodied))
     {
         embodying         = true;
         selectedCharacter = nEmbodied;
         byte oldSelectedBlock = inputHandler.selectedBlockType;
         inputHandler = new FirstPersonInputHandler(selectedCharacter);
         inputHandler.selectedBlockType = oldSelectedBlock;
         selectedCharacter.wasJustEmbodiedByPlayer();
         selectedCharacter.quitCurrentJob();
     }
 }