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