Changeset 551 for AE/Installer/trunk
- Timestamp:
- May 27, 2010, 10:30:35 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/Installer/trunk/source/installer.cpp
r550 r551 598 598 directory_iterator end_iter; 599 599 600 for ( directory_iterator dir_itr( vanilla_dir ); 601 dir_itr != end_iter; 602 ++dir_itr ) 603 { 604 if ( is_directory( dir_itr->status() ) ) 605 { 600 601 char levelnums[256] = {0}; 602 603 604 605 for(int k = 0; k < 256; k++) { 606 if( exists( (path)("./VanillaDats/level" + lexical_cast<std::string>(k) + "_final/") ) ) { 607 levelnums[k] = 1; 608 609 } 610 } 611 612 for (int i = installedMods.size() - 1; i >= 0; i--) { //Iterates through the installed mods (backwards :P) 613 for (unsigned int j = 0; j < globalPackages.size(); ++j) { //looking in the global packages 614 if (globalPackages[j].modStringName == installedMods[i]) { //for a mod that has BSL in it 615 for(int k = 0; k < 256; k++) { 616 if( globalPackages[j].hasOnis && 617 exists( (path)("packages/" + globalPackages[j].modStringName + "/oni/level" + lexical_cast<std::string>(k) + "_final/") ) ) { 618 levelnums[k] = 1; 619 620 } 621 } 622 } 623 } 624 } 625 for (int levelnum = 0; levelnum < 256; levelnum++) 626 if (levelnums[levelnum]) 606 627 numberOfDats++; 607 } 608 } 609 628 610 629 out << numberOfDats; 611 630 datString = out.str(); 612 613 for ( directory_iterator dir_itr( vanilla_dir ); 614 dir_itr != end_iter; 615 ++dir_itr ) 616 { 631 632 for(int levelnum = 0; levelnum < 256; levelnum++) { 617 633 try 618 634 { 619 if ( is_directory( dir_itr->status() ))635 if ( levelnums[levelnum] ) 620 636 { 621 importCommand = strOniSplit + " " + strImportOption + " " + vanilla_dir.string() + dir_itr->path().filename() + "";637 importCommand = strOniSplit + " " + strImportOption + " " + vanilla_dir.string() + "level" + lexical_cast<std::string>(levelnum) + "_Final "; 622 638 for (unsigned int i = 0; i < installedMods.size(); ++i) { 623 if (exists( "packages/" + installedMods[i] + "/oni/" + dir_itr->path().filename()))624 importCommand += " packages/" + installedMods[i] + "/oni/ " + dir_itr->path().filename();639 if (exists((path)("packages/" + installedMods[i] + "/oni/level" + lexical_cast<std::string>(levelnum) + "_final") )) 640 importCommand += " packages/" + installedMods[i] + "/oni/level" + lexical_cast<std::string>(levelnum) + "_Final"; 625 641 } 626 importCommand += " ../GameDataFolder/ " + dir_itr->path().filename() + ".dat >> Install.log";642 importCommand += " ../GameDataFolder/level" + lexical_cast<std::string>(levelnum) + "_Final.dat >> Install.log"; 627 643 628 644 setProgressBar( (int)(1000 * (float)(j-1) / (float)numberOfDats) ); //100% * dat we're on / total dats 629 645 setStatusArea("Step " + lexical_cast<std::string>(j) + '/' + lexical_cast<std::string>(numberOfDats)+ ": Importing " + 630 dir_itr->path().filename()+ " ");646 "level" + lexical_cast<std::string>(levelnum) + "_Final"+ " "); 631 647 system(importCommand.c_str()); 632 648 j++;
Note:
See TracChangeset
for help on using the changeset viewer.