コード例 #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);
  }
コード例 #2
0
 @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;
 }
コード例 #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);
  }
コード例 #4
0
 public void showPopup() {
   nifty.showPopup(nifty.getCurrentScreen(), popup.getId(), null);
 }
コード例 #5
0
 private void showCredits() {
   nifty.showPopup(screen, creditsPopup.getId(), null);
 }