Ejemplo n.º 1
0
  public void OpenMenuPopup() {
    CloseMenuPopup();
    Game game = Main.app.getStateManager().getState(Game.class);
    game.Pause(true);

    MenuPopup = nifty.createPopup("MenuPopup");
    nifty.showPopup(screen, MenuPopup.getId(), null);
  }
 @Override
 public boolean keyEvent(final NiftyInputEvent inputEvent) {
   if (inputEvent == NiftyInputEvent.ConsoleToggle) {
     if (screen.isActivePopup(consolePopup)) {
       nifty.closePopup(consolePopup.getId());
     } else {
       nifty.showPopup(screen, consolePopup.getId(), null);
     }
     return true;
   }
   return false;
 }
Ejemplo n.º 3
0
  public void OpenPopulationPopup() {
    ClosePopulationPopup();
    Game game = Main.app.getStateManager().getState(Game.class);
    game.Pause(true);
    // prevent mouse wheel interfering with scrolling a menu
    // TODO there may be a better way of doing this, e.g. nifty not passing the mousewheel event to
    // the game.
    disableMouseWheel();

    PopulationPopup = nifty.createPopup("PopulationPopup");
    nifty.showPopup(screen, PopulationPopup.getId(), null);
  }
 public void showPopup() {
   nifty.showPopup(nifty.getCurrentScreen(), popup.getId(), null);
 }
 private void showCredits() {
   nifty.showPopup(screen, creditsPopup.getId(), null);
 }