Changeset 737 for java/installer2/src/net/oni2/aeinstaller/backend
- Timestamp:
- Mar 23, 2013, 1:21:28 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/installer2/src/net/oni2/aeinstaller/backend/oni/Installer.java
r720 r737 37 37 import org.javabuilders.swing.SwingJavaBuilder; 38 38 39 import com.paour.NaturalOrderComparator; 39 40 import com.thoughtworks.xstream.XStream; 40 41 import com.thoughtworks.xstream.io.xml.StaxDriver; … … 226 227 || s.endsWith(".raw") 227 228 || s.endsWith(".sep") 228 || (s.equals("intro.bik") && !SettingsManager .getInstance()229 .get ("copyintro", false))230 || (s.equals("outro.bik") && !SettingsManager .getInstance()231 .get ("copyoutro", false));229 || (s.equals("intro.bik") && !SettingsManager 230 .getInstance().get("copyintro", false)) 231 || (s.equals("outro.bik") && !SettingsManager 232 .getInstance().get("copyoutro", false)); 232 233 } 233 234 })) { … … 313 314 } 314 315 315 TreeMap<String, Vector<File>> levels = new TreeMap<String, Vector<File>>( );316 TreeMap<String, Vector<File>> levels = new TreeMap<String, Vector<File>>(new NaturalOrderComparator()); 316 317 for (File path : foldersOni) { 317 318 for (File levelF : path.listFiles()) { … … 407 408 File bslWin = CaseInsensitiveFile.getCaseInsensitiveFile(bsl, 408 409 "win_only"); 409 if (PlatformInformation.getPlatform() == Platform.MACOS && bslMac.exists()) { 410 if (PlatformInformation.getPlatform() == Platform.MACOS 411 && bslMac.exists()) { 410 412 for (File f : bslMac.listFiles(dirFileFilter)) { 411 413 File targetBSL = new File(targetBaseFolder, f.getName()); … … 477 479 tmpFolder.mkdir(); 478 480 479 HashMap<String, Vector<File>> patches = new HashMap<String, Vector<File>>();481 TreeMap<String, Vector<File>> patches = new TreeMap<String, Vector<File>>(new NaturalOrderComparator()); 480 482 for (File patchFolder : patchFolders) { 481 483 for (File levelFolder : patchFolder.listFiles(dirFileFilter)) { … … 509 511 if (srcFolder.getPath().toLowerCase().contains("vanilla")) { 510 512 // Extract from .dat 511 ApplicationInvocationResult res = OniSplit.export( levelFolder,512 srcFolder, exportPatterns);513 ApplicationInvocationResult res = OniSplit.export( 514 levelFolder, srcFolder, exportPatterns); 513 515 logAppOutput(res, log); 514 516 } … … 557 559 Vector<File> files = new Vector<File>(); 558 560 files.add(new File(levelFolder, "*.oni")); 559 ApplicationInvocationResult res = OniSplit.convertOniToXML( levelFolderXML,560 files);561 ApplicationInvocationResult res = OniSplit.convertOniToXML( 562 levelFolderXML, files); 561 563 logAppOutput(res, log); 562 564 … … 599 601 long startMS = new Date().getTime(); 600 602 601 int totalSteps = 0;603 int totalSteps = oniLevelFolders.size() + 1; 602 604 int stepsDone = 0; 603 604 for (@SuppressWarnings("unused")605 String s : oniLevelFolders.keySet())606 totalSteps++;607 totalSteps++;608 605 609 606 log.println(); … … 614 611 "Installing level " + l); 615 612 616 ApplicationInvocationResult res = OniSplit.packLevel( oniLevelFolders.get(l),617 new File(Paths.getEditionGDF(), sanitizeLevelName(l)618 + ".dat"));613 ApplicationInvocationResult res = OniSplit.packLevel( 614 oniLevelFolders.get(l), new File(Paths.getEditionGDF(), 615 sanitizeLevelName(l) + ".dat")); 619 616 logAppOutput(res, log); 620 617 … … 690 687 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 691 688 692 for (@SuppressWarnings("unused") 693 File f : Paths.getVanillaGDF().listFiles(new FilenameFilter() { 689 TreeSet<File> levelFiles = new TreeSet<File>( 690 new NaturalOrderComparator()); 691 692 for (File f : Paths.getVanillaGDF().listFiles(new FilenameFilter() { 694 693 @Override 695 694 public boolean accept(File dir, String name) { … … 698 697 })) { 699 698 totalSteps++; 699 levelFiles.add(f); 700 700 } 701 701 totalSteps = totalSteps * 2 + 2; … … 722 722 log.println("Exporting levels and moving files to level0"); 723 723 724 for (File f : Paths.getVanillaGDF().listFiles(new FilenameFilter() { 725 @Override 726 public boolean accept(File dir, String name) { 727 return name.endsWith(".dat"); 728 } 729 })) { 724 for (File f : levelFiles) { 730 725 String levelName = f.getName().substring(0, 731 726 f.getName().indexOf('.')); … … 742 737 743 738 // Export Vanilla-Level-Dat -> Temp/Level 744 ApplicationInvocationResult res = OniSplit.export(tempLevelFolder, f); 739 ApplicationInvocationResult res = OniSplit.export( 740 tempLevelFolder, f); 745 741 logAppOutput(res, log); 746 742 … … 753 749 754 750 log.println("Reimporting levels"); 755 751 TreeSet<File> initFolders = new TreeSet<File>(new NaturalOrderComparator()); 756 752 for (File f : init.listFiles()) { 753 initFolders.add(f); 754 } 755 756 for (File f : initFolders) { 757 757 String levelName = f.getName(); 758 758 … … 923 923 } 924 924 925 private static void logAppOutput(ApplicationInvocationResult result, PrintWriter log) { 925 private static void logAppOutput(ApplicationInvocationResult result, 926 PrintWriter log) { 926 927 if (result != null) { 927 928 log.println("\t\t\tCalled:");
Note:
See TracChangeset
for help on using the changeset viewer.