コード例 #1
0
  @Override
  public void HUDAreaClicked(HUDArea ha) {
    HUDArea hudArea = null;

    for (int i = 0; i < hudAreas.size(); i++) {
      hudArea = hudAreas.get(i);
      if (hudArea == ha) {
        if (hudArea.getType().equals("main_menu")) {
          SoundClip cl = new SoundClip("Misc/Click");
          hudManager.unloadHUD(name);
          hudManager.togglePauseHUD();
        } else if (hudArea.getType().equals("exit")) {
          SoundClip cl = new SoundClip("Misc/Click");
          hudManager.unloadHUD(name);
          hudManager.resumeMasterGame();
        } else if (hudArea.getType().equals("next")) {
          SoundClip cl = new SoundClip("Misc/Click");
          if (currentImage < IMAGE_COUNT) {
            currentImage++;
            setImage("HUD/Tutorial/" + currentImage);
          }
          if (currentImage >= IMAGE_COUNT) {
            hudArea.setIsActive(false);
            this.getHUDAreaByType("finish").setIsActive(true);
          }
        } else if (hudArea.getType().equals("finish")) {
          SoundClip cl = new SoundClip("Misc/Click");
          hudManager.unloadHUD(name);
          hudManager.resumeMasterGame();
        }
      }
    }
  }
コード例 #2
0
  @Override
  public void HUDAreaClicked(HUDArea ha) {
    HUDArea hudArea = null;

    for (int i = 0; i < hudAreas.size(); i++) {
      hudArea = hudAreas.get(i);
      if (hudArea == ha) {
        if (hudArea.getType().equals("single_player")) {
          hudManager.unloadHUD(name);
          hudManager.loadHUD(HUDManager.HUDType.ScreenCharacterSelection);
        } else if (hudArea.getType().equals("multi_player")) {
          if (hudManager.getIsOnline() && Game.VERSION.equals(hudManager.getCurrentVersion())) {
            hudManager.unloadHUD(name);
            hudManager.loadHUD(HUDManager.HUDType.ScreenMultiPlayer);
          } else {
            registry.showMessage(
                "Error",
                "Must be online and have latest version to play.  Try updating and restarting.");
          }
        } else if (hudArea.getType().equals("settings")) {
          hudManager.unloadHUD(name);
          hudManager.loadHUD(HUDManager.HUDType.ScreenSettings);
        } else if (hudArea.getType().equals("exit")) {
          hudManager.gameExit();
        } else if (hudArea.getType().equals("donate")) {
          String url = "http://www.epicinventor.com/donate.html";

          try {
            Desktop.getDesktop().browse(java.net.URI.create(url));
          } catch (Exception e) {
          }
        } else if (hudArea.getType().equals("help")) {
          String url = "http://www.epicinventor.com/help.html";

          try {
            Desktop.getDesktop().browse(java.net.URI.create(url));
          } catch (Exception e) {
          }
        } else if (hudArea.getType().equals("download")) {
          Process p = null;
          try {
            p = Runtime.getRuntime().exec("EpicInventorUpdater");
          } catch (IOException ex) {
          }

          if (p == null) {
            registry.showMessage(
                "Error", "Could not launch auto-updater, run manually from folder");
          } else {
            hudManager.gameExit();
          }
        }
      }
    }
  }