Exemple #1
0
  public static void loadParams() {
    InputStream is = null;
    if (JMupenUtils.getConf().exists()) {
      // First try loading from the current directory
      try {
        is = new FileInputStream(JMupenUtils.getConf());
      } catch (Exception e) {
        is = null;
      }

      try {
        props.load(is);
        JMupenUtils.setFullscreen(props.get("Fullscreen").equals("true"));
        JMupenUtils.setUsingLegacyVersion(props.get("UsingLegacy").equals("true"));
        JMupenUtils.setSaveFolder(
            !props.get("SaveFolder").equals("")
                ? new File((String) props.get("SaveFolder"))
                : null);
      } catch (Exception e) {
        saveParamChanges();
      }
    } else {
      saveParamChanges();
    }
  }
Exemple #2
0
 public static void resetSaveFolder() {
   JMupenUtils.setSaveFolder(
       new File(JMupenUtils.getJmupenHome().concat(JMupenUtils.getBar()).concat("save")));
   props.setProperty(
       "SaveFolder", JMupenUtils.getJmupenHome().concat(JMupenUtils.getBar()).concat("save"));
   saveParamChanges();
 }
Exemple #3
0
 public static File getSaveFolder() {
   if (!saveFolder.canRead() && !saveFolder.canWrite()) {
     JMupenGUI.getInstance()
         .showError(
             "Can't read savefiles directory.", "Rolling back to default savefiles directory.");
     JMupenUtils.setSaveFolder(new File(JMupenUtils.getJmupenSaveDir()));
     JMupenUtils.saveParamChanges();
   }
   return saveFolder;
 }