private void OnLeftShoulderButtonPress(object sender, GamepadButtonEventArgs evt) { if (evt.Button == GamepadButtons.LeftShoulder) { ; } }
private void OnRightShoulderButtonRelease(object sender, GamepadButtonEventArgs evt) { if (evt.Button == GamepadButtons.RightShoulder) { ; } }
private void OnLeftThumbButtonRelease(object sender, GamepadButtonEventArgs evt) { if (evt.Button == GamepadButtons.LeftThumb) { ; } }
private void OnRightThumbButtonPress(object sender, GamepadButtonEventArgs evt) { if (evt.Button == GamepadButtons.RightThumb) { ; } }
private void OnStartButtonRelease(object sender, GamepadButtonEventArgs evt) { if (evt.Button == GamepadButtons.Start) { Text = "Expected Start button, got " + evt.Button; } }
private void OnBackButtonRelease(object sender, GamepadButtonEventArgs evt) { if (evt.Button == GamepadButtons.Back) { Text = "Expected Back button, got " + evt.Button; } }
private void OnAButtonPress(object sender, GamepadButtonEventArgs evt) { if (evt.Button == GamepadButtons.A) { Text = "Expected A button, got " + evt.Button; } }
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(); } }
private void OnYButtonPress(object sender, GamepadButtonEventArgs evt) { if (evt.Button == GamepadButtons.Y) { myStage.Zero(enAxis.Y); Text = "Expected Y button, got " + evt.Button; } }
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(); } }
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)); } }
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(); } }