ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/AE/Installer/trunk/source/main_window.cpp
(Generate patch)

Comparing AE/Installer/trunk/source/main_window.cpp (file contents):
Revision 461 by gumby, Fri Oct 9 03:22:08 2009 UTC vs.
Revision 462 by gumby, Sat Oct 10 02:49:27 2009 UTC

# Line 722 | Line 722 | void recompileAll(vector<string> install
722  
723  
724  
725 <                ofstream BSLlog("BSL.log");
725 >                
726                  
727                  vector<string> BSLfolders;
728                  vector<string> skippedfolders;
729  
730                  
731 <
731 > ofstream BSLlog("BSL.log");
732                  for ( directory_iterator dir_itr( "../GameDataFolder/IGMD/" ), end_itr;
733                          dir_itr != end_itr;
734                          ++dir_itr ) {
# Line 741 | Line 741 | void recompileAll(vector<string> install
741                  for (int i = installedMods.size() - 1; i >= 0; i--) {                                                   //Iterates through the installed mods (backwards :P)
742                          for (unsigned int j = 0; j < globalPackages.size(); ++j) {                              //looking in the global packages
743                                  if (globalPackages[j].modStringName == installedMods[i]) {      //for a mod that has BSL in it
744 <                                        BSLlog << "Testing " << globalPackages[j].modStringName << "\n"
744 >                                /*BSLlog << "Testing " << globalPackages[j].modStringName << "\n"
745                                                  << "HasBSL: " << globalPackages[j].hasBSL << "\n"
746 <                                                << "HasAddon: " << globalPackages[j].hasAddon << "\n";
746 >                                                << "HasAddon: " << globalPackages[j].hasAddon << "\n";*/
747                                          if(!(globalPackages[j].hasAddon || globalPackages[j].hasBSL)) break; //skip non-BSL
748 <                                        if( exists( "packages/" + globalPackages[j].modStringName + "/BSL" ) )
748 >                                        if( exists( "packages/" + globalPackages[j].modStringName + "/BSL/" ) ) {
749                                          copyBSL("packages/" + globalPackages[j].modStringName + "/BSL", BSLfolders, globalPackages[j] );
750 +                                        BSLlog << "Copied " <<  globalPackages[j].modStringName << "!\n";
751 +                                        }
752 +
753                                  }
754  
755                          }
756                  }
757  
758                  ModPackage emptyPackage;
759 +                emptyPackage.modStringName = "VanillaBSL";
760 +                emptyPackage.hasBSL = 1;
761                  copyBSL("packages/VanillaBSL/IGMD", BSLfolders, emptyPackage);
762                  BSLlog.close();
763          
# Line 763 | Line 768 | void recompileAll(vector<string> install
768          
769          string finallyDone = "Done! You can now play Oni.";
770          
771 < a
771 >
772          
773          setStatusArea(finallyDone);
774  
# Line 797 | Line 802 | a
802          busy = 0;
803   }
804  
805 < void copyBSL(string copypath, vector<string> BSLfolders, ModPackage pkg) {
805 > void copyBSL(string copypath, vector<string>& BSLfolders, ModPackage pkg) {
806 >
807 >        ofstream BSLlog("BSL2.log", ios::app );
808 >        
809          try {
810                  for ( directory_iterator dir_itr( copypath ), end_itr;
811                          dir_itr != end_itr;
812                          ++dir_itr ) {
813  
814                                  if ( is_directory( dir_itr->path() ) && dir_itr->path().string() != ".svn" ) {  
815 +                                        BSLlog << "Testing " << dir_itr->path().string() << " HasBSL: " << pkg.hasBSL << " HasAddon: " << pkg.hasAddon << "\n";
816                                          int skip_folder = 0;
817 +
818                                          for(unsigned int k = 0; k < BSLfolders.size(); k++)             {//iterate through already found BSL folders    
819 +                                                BSLlog << "testing " << dir_itr->path().filename() << " vs " << BSLfolders[k] << "\n";
820                                                  if(dir_itr->path().filename() == BSLfolders[k]) {
821 <                                                        skip_folder = 1;                        
821 >                                                        skip_folder = 1;
822 >                                                        BSLlog << "skipping " << BSLfolders[k] << " in " << pkg.modStringName << "\n";
823                                                          break;
824                                                  }
825                                          }
# Line 815 | Line 827 | void copyBSL(string copypath, vector<str
827                                                  remove_all( "../GameDataFolder/IGMD/" + dir_itr->path().filename() );
828                                                  Sleep(100);
829                                                  create_directory( "../GameDataFolder/IGMD/" + dir_itr->path().filename());
830 <
830 >                                                BSLlog << "Copied " << dir_itr->path().string() << " in " << pkg.modStringName << "!\n";
831                                                  for ( directory_iterator bsl_itr( dir_itr->path() );
832                                                          bsl_itr != end_itr;
833                                                          bsl_itr++ ) {
# Line 823 | Line 835 | void copyBSL(string copypath, vector<str
835                                                                          copy_file(bsl_itr->path(),  "../GameDataFolder/IGMD/" + dir_itr->path().filename() + "/" + bsl_itr->path().filename());
836                                                                  }
837                                                  }
838 <                                                BSLfolders.push_back( dir_itr->path().filename() );
838 >                                                BSLfolders.push_back( dir_itr->path().filename() ); //add back check for addon
839 >                                                BSLlog << "Pushing " << dir_itr->path().filename() << "\n" ;
840                                          }
841                                  }
842                  }
# Line 833 | Line 846 | void copyBSL(string copypath, vector<str
846                  setStatusArea("Warning, exception " + (string)ex.what() + "!");
847                  while(1) Sleep(1000);
848          }
849 <
849 >        BSLlog.close();
850 >        
851   }
852 <                        
853 <                        
852 >
853 >
854   void writeInstalledMods(vector<string> installedMods)
855   {
856  

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)