Пример #1
0
 public override void HandleInput(GamePadState gamePadState, KeyboardState keyState, MouseState mouseState)
 {
     if (InputHandler.WasKeyPressed(keyState, KeyConfig.KeyList[4], 10))
     {
         if (remainingText.Replace(" ", "") == "")
         {
             if (messageQueue.Count > 0)
             {
                 splitMessage(messageQueue.Dequeue());
                 setPosition();
             }
             else
             {
                 Close();
             }
         }
         else
         {
             splitMessage(remainingText);
             menuWindow.ChangeOption(0, lineOne);
             if (lineTwo.Replace(" ", "") == "")
             {
                 menuWindow.RemoveOption(1);
                 setPosition();
             }
             else
             {
                 menuWindow.ChangeOption(1, lineTwo);
                 setPosition();
             }
         }
     }
 }
Пример #2
0
        public override void Update(GameTime gameTime)
        {
            menuWindow.ChangeOption(0, textBox.GetText());

            menuWindow.Position = new Vector2(
                (ScreenHandler.SCREEN_WIDTH / 2) - (menuWindow.size.x * 16),
                (ScreenHandler.SCREEN_HEIGHT / 2) - (menuWindow.size.y * 16));
        }
Пример #3
0
        private void UpdateBaseOption(int index)
        {
            string textspeed = "Text Speed: ";

            switch (ScreenHandler.GameOptions.TextSpeed)
            {
            case 0: textspeed += "Slow"; break;

            case 1: textspeed += "Medium"; break;

            case 2: textspeed += "Fast"; break;

            default: textspeed += "oh god an error what the f**k"; break;
            }


            switch (index)
            {
            case 0: optionsMenu.ChangeOption(index, (textspeed)); break;

            case 1: optionsMenu.ChangeOption(index, String.Format("Battle Scene: {0}", ScreenHandler.GameOptions.BattleScene ? "Animate" : "Don't Animate")); break;

            case 2: optionsMenu.ChangeOption(index, String.Format("Battle Style: {0}", ScreenHandler.GameOptions.BattleStyle ? "Shift" : "Set")); break;

            case 3: optionsMenu.ChangeOption(index, String.Format("Sound: {0}", ScreenHandler.GameOptions.Sound ? "On" : "Off")); break;

            case 4: optionsMenu.ChangeOption(index, "Key Config"); break;

            case 5: optionsMenu.ChangeOption(index, String.Format("Frame: {0}", ScreenHandler.GameOptions.Frame.ToString())); break;
            }
        }
Пример #4
0
 public override void HandleInput(GamePadState gamePadState, KeyboardState keyState, MouseState mouseState)
 {
     if (InputHandler.WasKeyPressed(keyState, KeyConfig.Action))
     {
         //handle options
         if (OptionBox.isVisible && OptionBox.isActive)
         {
             //finalize the choice the user makes
             OptionBox.isVisible = false;
             lock (TFSH.PokeEngineScriptHelper.lockObject)
             {
                 //send pulse to method to continue execution
                 Monitor.PulseAll(TFSH.PokeEngineScriptHelper.lockObject);
             }
             Close();
         }
         //handle regular text
         else
         {
             if (remainingText.Replace(" ", "") == "")
             {
                 if (messageQueue.Count > 0)
                 {
                     ShowDialog(messageQueue.Dequeue());
                     setPosition();
                 }
                 else if (!currentMessage.hasOptions)
                 {
                     Close();
                 }
             }
             else
             {
                 ShowDialog(new Message(remainingText));
                 menuWindow.ChangeOption(0, lineOne);
                 if (lineTwo.Replace(" ", "") == "")
                 {
                     menuWindow.RemoveOption(1);
                     setPosition();
                 }
                 else
                 {
                     menuWindow.ChangeOption(1, lineTwo);
                     setPosition();
                 }
             }
         }
     }
     //press up to decrease option choice by 1, minimum is zero
     if (InputHandler.WasKeyPressed(keyState, KeyConfig.Up, 10))
     {
         if (OptionBox.isVisible)
         {
             choice--;
             if (choice < 0)
             {
                 choice = 0;
             }
             if (choice < OptionBox.topChoice)
             {
                 OptionBox.topChoice--;
             }
         }
     }
     //press down to increase option choice by 1, maximum of options.length-1 (cause zero index)
     if (InputHandler.WasKeyPressed(keyState, KeyConfig.Down, 10))
     {
         if (OptionBox.isVisible)
         {
             choice++;
             if (choice >= OptionBox.options.Length)
             {
                 choice = OptionBox.options.Length - 1;
             }
             if (choice > OptionBox.topChoice + 3)
             {
                 OptionBox.topChoice++;
             }
         }
     }
 }