Ejemplo n.º 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("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();
          }
        }
      }
    }
  }
Ejemplo n.º 2
0
 public AttachmentPart getAttachment(java.net.URI ref, Iterator iter) {
   if (iter == null || ref == null) {
     System.err.println("getAttachment: null Iterator for AttachmentPart");
     return null;
   }
   while (iter.hasNext()) {
     AttachmentPart tempAttachment = (AttachmentPart) iter.next();
     if (ref.isOpaque() && ref.getScheme().equals("cid")) {
       String refId = ref.getSchemeSpecificPart();
       String cId = tempAttachment.getContentId();
       if (cId.equals("<" + refId + ">") || cId.equals(refId)) {
         return tempAttachment;
       }
     }
   }
   return null;
 }