Changeset 623 for AE/installer2/src/net/oni2/aeinstaller/backend
- Timestamp:
- Jan 16, 2013, 11:25:00 AM (12 years ago)
- Location:
- AE/installer2/src/net/oni2/aeinstaller/backend
- Files:
-
- 1 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/installer2/src/net/oni2/aeinstaller/backend/Settings.java
r621 r623 80 80 Vector<String> res = null; 81 81 try { 82 res = QuickAppExecution.execute(cmd);82 res = AppExecution.executeAndWait(cmd); 83 83 } catch (IOException e) { 84 84 e.printStackTrace(); … … 134 134 Vector<String> res = null; 135 135 try { 136 res = QuickAppExecution.execute(cmd);136 res = AppExecution.executeAndWait(cmd); 137 137 } catch (IOException e) { 138 138 e.printStackTrace(); -
AE/installer2/src/net/oni2/aeinstaller/backend/mods/Mod.java
r622 r623 26 26 27 27 private HashSet<Type> types = new HashSet<Type>(); 28 private boolean tool = false; 28 29 private ECompatiblePlatform platform = null; 29 30 private String version = ""; … … 36 37 private net.oni2.aeinstaller.backend.depot.model.File file = null; 37 38 39 private File exeFile = null; 40 private File iconFile = null; 41 private String workingDir = "Base"; 42 38 43 private HashSet<Integer> incompatibilities = new HashSet<Integer>(); 39 44 private HashSet<Integer> dependencies = new HashSet<Integer>(); 45 private HashSet<Integer> unlockLevel = new HashSet<Integer>(); 40 46 41 47 private long localTimestamp = 0; … … 52 58 packageNumber = nm.getPackageNumber(); 53 59 platform = nm.getPlatform(); 60 tool = nm.isTool(); 54 61 for (TaxonomyTerm tt : nm.getTypes()) { 55 62 Type t = ModManager.getInstance().getTypeByName(tt.getName()); 56 63 types.add(t); 57 if (! nm.isTool()&& !isMandatoryMod() && isValidOnPlatform())64 if (!tool && !isMandatoryMod() && isValidOnPlatform()) 58 65 t.addEntry(this); 59 66 } … … 76 83 File config = new File(getLocalPath(), "Mod_Info.cfg"); 77 84 File aeicfg = new File(getLocalPath(), "aei.cfg"); 85 File plain = new File(getLocalPath(), "plain"); 78 86 if (config.exists()) { 79 87 try { … … 131 139 } 132 140 } 141 } else if (sName.equalsIgnoreCase("UnlockLevel")) { 142 String[] levelsS = sVal.split(","); 143 for (String s : levelsS) { 144 try { 145 int level = Integer.parseInt(s); 146 unlockLevel.add(level); 147 } catch (NumberFormatException e) { 148 System.err 149 .format("Mod %05d does contain a non-number UnlockLevel value: '%s'\n", 150 packageNumber, s); 151 } 152 } 153 } else if (sName.equalsIgnoreCase("ExeName")) { 154 exeFile = new File(Paths.getEditionBasePath(), sVal); 155 } else if (sName.equalsIgnoreCase("WorkingDir")) { 156 workingDir = sVal; 157 } else if (sName.equalsIgnoreCase("IconName")) { 158 iconFile = new File(Paths.getEditionBasePath(), sVal); 133 159 } 134 160 } … … 166 192 } 167 193 } 194 if (node == null) 195 tool = plain.exists(); 168 196 } 169 197 … … 254 282 255 283 /** 284 * @return Is this mod actually a tool? 285 */ 286 public boolean isTool() { 287 return tool; 288 } 289 290 /** 256 291 * @return Compatible platforms 257 292 */ … … 326 361 public HashSet<Integer> getDependencies() { 327 362 return dependencies; 363 } 364 365 /** 366 * @return the levels this mod will unlock 367 */ 368 public HashSet<Integer> getUnlockLevels() { 369 return unlockLevel; 370 } 371 372 /** 373 * @return Executable name of this tool 374 */ 375 public File getExeFile() { 376 return exeFile; 377 } 378 /** 379 * @return Icon file of this tool 380 */ 381 public File getIconFile() { 382 return iconFile; 383 } 384 385 /** 386 * @return Working directory of this tool 387 */ 388 public File getWorkingDir() { 389 if (workingDir.equalsIgnoreCase("Exe")) { 390 if (exeFile != null) 391 return exeFile.getParentFile(); 392 else 393 return Paths.getEditionGDF(); 394 } else if (workingDir.equalsIgnoreCase("GDF")) 395 return Paths.getEditionGDF(); 396 else 397 return Paths.getEditionBasePath(); 328 398 } 329 399 -
AE/installer2/src/net/oni2/aeinstaller/backend/mods/ModManager.java
r621 r623 253 253 254 254 /** 255 * Get a mod by its package number 255 * @return Currently installed tools 256 */ 257 public TreeSet<Mod> getInstalledTools() { 258 TreeSet<Mod> res = new TreeSet<Mod>(); 259 for (int n : Installer.getInstalledTools()) { 260 res.add(getModByNumber(n)); 261 } 262 return res; 263 } 264 265 /** 266 * Get a mod/tool by its package number 256 267 * 257 268 * @param number 258 269 * Package number 259 * @return Mod or null270 * @return Mod/tool or null 260 271 */ 261 272 public Mod getModByNumber(int number) { 262 for (Mod m : mods.values()) {263 if (m.getPackageNumber() == number)264 return m;265 }273 if (mods.containsKey(number)) 274 return mods.get(number); 275 if (tools.containsKey(number)) 276 return tools.get(number); 266 277 return null; 267 278 }
Note:
See TracChangeset
for help on using the changeset viewer.