Пример #1
0
 private void OnLeftShoulderButtonPress(object sender, GamepadButtonEventArgs evt)
 {
     if (evt.Button == GamepadButtons.LeftShoulder)
     {
         ;
     }
 }
Пример #2
0
 private void OnRightShoulderButtonRelease(object sender, GamepadButtonEventArgs evt)
 {
     if (evt.Button == GamepadButtons.RightShoulder)
     {
         ;
     }
 }
Пример #3
0
 private void OnLeftThumbButtonRelease(object sender, GamepadButtonEventArgs evt)
 {
     if (evt.Button == GamepadButtons.LeftThumb)
     {
         ;
     }
 }
Пример #4
0
 private void OnRightThumbButtonPress(object sender, GamepadButtonEventArgs evt)
 {
     if (evt.Button == GamepadButtons.RightThumb)
     {
         ;
     }
 }
Пример #5
0
 private void OnStartButtonRelease(object sender, GamepadButtonEventArgs evt)
 {
     if (evt.Button == GamepadButtons.Start)
     {
         Text = "Expected Start button, got " + evt.Button;
     }
 }
Пример #6
0
 private void OnBackButtonRelease(object sender, GamepadButtonEventArgs evt)
 {
     if (evt.Button == GamepadButtons.Back)
     {
         Text = "Expected Back button, got " + evt.Button;
     }
 }
Пример #7
0
 private void OnAButtonPress(object sender, GamepadButtonEventArgs evt)
 {
     if (evt.Button == GamepadButtons.A)
     {
         Text = "Expected A button, got " + evt.Button;
     }
 }
Пример #8
0
        private void GSelection(object sender, GamepadButtonEventArgs e)
        {
            if (e.Button == GamepadButton.DPadDown)
            {
                if (index + 1 < Options.Count)
                {
                    index++;
                }
                else
                {
                    index = 0;
                }

                ColorTxtRender();
            }

            if (e.Button == GamepadButton.DPadUp)
            {
                if (index - 1 < 0)
                {
                    index = Options.Count - 1;
                }
                else
                {
                    index--;
                }

                ColorTxtRender();
            }
        }
Пример #9
0
 private void OnYButtonPress(object sender, GamepadButtonEventArgs evt)
 {
     if (evt.Button == GamepadButtons.Y)
     {
         myStage.Zero(enAxis.Y);
         Text = "Expected Y button, got " + evt.Button;
     }
 }
Пример #10
0
 private void OnAButtonRelease(object sender, GamepadButtonEventArgs evt)
 {
     if (evt.Button == GamepadButtons.A)
     {
         myStage.Stop();
         Text = "Expected A button, got " + evt.Button;
     }
 }
 private void Gamepad_ButtonDown(object sender, GamepadButtonEventArgs e)
 {
     if (e.Button == GamepadButton.RightShoulder && cooldown > ReloadTime)
     {
         cooldown = 0;
         Fire();
     }
 }
Пример #12
0
        private void OnButtonPress(object sender, GamepadButtonEventArgs args)
        {
            ButtonConfig currentButton = GetCurrentButton(args.Button);

            if (currentButton != null && args.IsPressed)
            {
                OnButtonDown?.Invoke(this, new GamepadHelperEventArgs(currentButton));
            }
            else
            {
                OnButtonUp?.Invoke(this, new GamepadHelperEventArgs(currentButton));
            }
        }
Пример #13
0
        private void GAdjustment(object sender, GamepadButtonEventArgs e)
        {
            if (e.Button == GamepadButton.DPadRight)
            {
                switch (index)
                {
                //music vol
                case 0:
                    if (GameManager.File.Res.musicVol < 1)
                    {
                        GameManager.File.Res.musicVol += 0.1f;
                        Options[0].Text.SourceText     = MUS + MathF.Round(GameManager.File.Res.musicVol, 1);
                    }
                    break;

                //sfx
                case 1:
                    if (GameManager.File.Res.sfxVol < 1)
                    {
                        GameManager.File.Res.sfxVol += 0.1f;
                        Options[1].Text.SourceText   = SFX + MathF.Round(GameManager.File.Res.sfxVol, 1);
                    }
                    break;

                //inv
                case 2:
                    GameManager.File.Res.Invincible = !GameManager.File.Res.Invincible;
                    if (GameManager.File.Res.Invincible)
                    {
                        Options[2].Text.SourceText = INV + "ON";
                    }
                    else
                    {
                        Options[2].Text.SourceText = INV + "OFF";
                    }
                    break;

                case 3:
                    GameManager.File.Res.Restarts = !GameManager.File.Res.Restarts;
                    if (GameManager.File.Res.Restarts)
                    {
                        Options[3].Text.SourceText = RS + "ON";
                    }
                    else
                    {
                        Options[3].Text.SourceText = RS + "OFF";
                    }
                    break;

                default:
                    break;
                }
                GameManager.SaveData();
            }

            if (e.Button == GamepadButton.DPadLeft)
            {
                switch (index)
                {
                //music vol
                case 0:
                    if (GameManager.File.Res.musicVol > 0)
                    {
                        GameManager.File.Res.musicVol -= 0.1f;
                        Options[0].Text.SourceText     = MUS + MathF.Round(GameManager.File.Res.musicVol, 1);
                    }
                    break;

                //sfx
                case 1:
                    if (GameManager.File.Res.sfxVol > 0)
                    {
                        GameManager.File.Res.sfxVol -= 0.1f;
                        Options[1].Text.SourceText   = SFX + MathF.Round(GameManager.File.Res.sfxVol, 1);
                    }
                    break;

                //inv
                case 2:
                    GameManager.File.Res.Invincible = !GameManager.File.Res.Invincible;
                    if (GameManager.File.Res.Invincible)
                    {
                        Options[2].Text.SourceText = INV + "ON";
                    }
                    else
                    {
                        Options[2].Text.SourceText = INV + "OFF";
                    }
                    break;

                case 3:
                    GameManager.File.Res.Restarts = !GameManager.File.Res.Restarts;
                    if (GameManager.File.Res.Restarts)
                    {
                        Options[3].Text.SourceText = RS + "ON";
                    }
                    else
                    {
                        Options[3].Text.SourceText = RS + "OFF";
                    }
                    break;

                default:
                    break;
                }
                GameManager.SaveData();
            }

            if (e.Button == GamepadButton.Y)
            {
                GameManager.GoToMainMenu();
            }
        }