Пример #1
0
 @Override
 public void keyPressed(int key, char c) {
   switch (key) {
     case Input.KEY_ESCAPE:
     case Input.KEY_Q:
       ((ButtonMenu) game.getState(Opsu.STATE_BUTTONMENU)).setMenuState(MenuState.EXIT);
       game.enterState(Opsu.STATE_BUTTONMENU);
       break;
     case Input.KEY_P:
       SoundController.playSound(SoundEffect.MENUHIT);
       if (!logoClicked) {
         logoClicked = true;
         logoTimer = 0;
         playButton.getImage().setAlpha(0f);
         exitButton.getImage().setAlpha(0f);
       } else enterSongMenu();
       break;
     case Input.KEY_D:
       SoundController.playSound(SoundEffect.MENUHIT);
       game.enterState(
           Opsu.STATE_DOWNLOADSMENU,
           new FadeOutTransition(Color.black),
           new FadeInTransition(Color.black));
       break;
     case Input.KEY_R:
       nextTrack();
       break;
     case Input.KEY_UP:
       UI.changeVolume(1);
       break;
     case Input.KEY_DOWN:
       UI.changeVolume(-1);
       break;
     case Input.KEY_F7:
       Options.setNextFPS(container);
       break;
     case Input.KEY_F10:
       Options.toggleMouseDisabled();
       break;
     case Input.KEY_F12:
       Utils.takeScreenShot();
       break;
   }
 }
Пример #2
0
 @Override
 public void keyPressed(int key, char c) {
   switch (key) {
     case Input.KEY_ESCAPE:
       if (menuState != null) menuState.leave(container, game);
       break;
     case Input.KEY_F7:
       Options.setNextFPS(container);
       break;
     case Input.KEY_F10:
       Options.toggleMouseDisabled();
       break;
     case Input.KEY_F12:
       Utils.takeScreenShot();
       break;
     default:
       if (menuState != null) menuState.keyPress(container, game, key, c);
       break;
   }
 }