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);
  }
  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 setSpeed(String NewSpeed) {
   int speed = Integer.parseInt(NewSpeed);
   Game game = Main.app.getStateManager().getState(Game.class);
   game.Pause(false);
   game.setTickRate(speed);
 }
 public void Pause() {
   Game game = Main.app.getStateManager().getState(Game.class);
   game.Pause(!game.isPaused());
 }