| 647 |
|
vector<string> skippedfolders; |
| 648 |
|
|
| 649 |
|
ofstream BSLlog("BSL.log"); |
| 650 |
+ |
if(exists("../GameDataFolder/BSLBackup/")) { |
| 651 |
+ |
remove_all("../GameDataFolder/BSLBackup/"); |
| 652 |
+ |
} |
| 653 |
+ |
else { |
| 654 |
+ |
create_directory("../GameDataFolder/BSLBackup/"); |
| 655 |
+ |
} |
| 656 |
+ |
copy("../GameDataFolder/IGMD/", "../GameDataFolder/BSLBackup/"); |
| 657 |
|
for ( directory_iterator dir_itr( "../GameDataFolder/IGMD/" ), end_itr; |
| 658 |
|
dir_itr != end_itr; |
| 659 |
|
++dir_itr ) { |
| 666 |
|
for (int i = installedMods.size() - 1; i >= 0; i--) { //Iterates through the installed mods (backwards :P) |
| 667 |
|
for (unsigned int j = 0; j < globalPackages.size(); ++j) { //looking in the global packages |
| 668 |
|
if (globalPackages[j].modStringName == installedMods[i]) { //for a mod that has BSL in it |
| 669 |
< |
if(!(globalPackages[j].hasAddon || globalPackages[j].hasBSL)) break; //skip non-BSL |
| 669 |
> |
if(globalPackages[j].hasBSL) break; //skip non-BSL |
| 670 |
|
if( exists( "packages/" + globalPackages[j].modStringName + "/BSL/" ) ) { |
| 671 |
|
copyBSL("packages/" + globalPackages[j].modStringName + "/BSL", BSLfolders, globalPackages[j] ); |
| 672 |
|
BSLlog << "Copied " << globalPackages[j].modStringName << "!\n"; |
| 675 |
|
} |
| 676 |
|
} |
| 677 |
|
|
| 678 |
+ |
|
| 679 |
+ |
|
| 680 |
|
ModPackage emptyPackage; |
| 681 |
|
emptyPackage.modStringName = "VanillaBSL"; |
| 682 |
|
emptyPackage.hasBSL = 1; |
| 683 |
|
copyBSL("packages/VanillaBSL/IGMD", BSLfolders, emptyPackage); |
| 684 |
|
BSLlog.close(); |
| 685 |
< |
|
| 685 |
> |
|
| 686 |
> |
for (int i = installedMods.size() - 1; i >= 0; i--) { //Iterates through the installed mods (backwards :P) |
| 687 |
> |
for (unsigned int j = 0; j < globalPackages.size(); ++j) { //looking in the global packages |
| 688 |
> |
if (globalPackages[j].modStringName == installedMods[i]) { //for a mod that has BSL in it |
| 689 |
> |
if(!globalPackages[j].hasAddon) break; //skip non-BSL |
| 690 |
> |
if( exists( "packages/" + globalPackages[j].modStringName + "/BSL/" ) ) { |
| 691 |
> |
copyBSL("packages/" + globalPackages[j].modStringName + "/BSL", BSLfolders, globalPackages[j] ); |
| 692 |
> |
BSLlog << "Copied " << globalPackages[j].modStringName << "!\n"; |
| 693 |
> |
} |
| 694 |
> |
} |
| 695 |
> |
} |
| 696 |
> |
} |
| 697 |
> |
|
| 698 |
|
logfile << "Writing config file"; |
| 699 |
|
writeInstalledMods(installedMods); |
| 700 |
|
setProgressBar(1000); |
| 735 |
|
if ( is_directory( dir_itr->path() ) && dir_itr->path().string() != ".svn" ) { |
| 736 |
|
BSLlog << "Testing " << dir_itr->path().string() << " HasBSL: " << pkg.hasBSL << " HasAddon: " << pkg.hasAddon << "\n"; |
| 737 |
|
int skip_folder = 0; |
| 738 |
< |
|
| 739 |
< |
for(unsigned int k = 0; k < BSLfolders.size(); k++) {//iterate through already found BSL folders |
| 740 |
< |
BSLlog << "testing " << dir_itr->path().filename() << " vs " << BSLfolders[k] << "\n"; |
| 741 |
< |
if(dir_itr->path().filename() == BSLfolders[k]) { |
| 742 |
< |
skip_folder = 1; |
| 743 |
< |
BSLlog << "skipping " << BSLfolders[k] << " in " << pkg.modStringName << "\n"; |
| 744 |
< |
break; |
| 738 |
> |
if(!pkg.hasAddon) { |
| 739 |
> |
for(unsigned int k = 0; k < BSLfolders.size(); k++) {//iterate through already found BSL folders |
| 740 |
> |
BSLlog << "testing " << dir_itr->path().filename() << " vs " << BSLfolders[k] << "\n"; |
| 741 |
> |
if(dir_itr->path().filename() == BSLfolders[k]) { |
| 742 |
> |
skip_folder = 1; |
| 743 |
> |
BSLlog << "skipping " << BSLfolders[k] << " in " << pkg.modStringName << "\n"; |
| 744 |
> |
break; |
| 745 |
> |
} |
| 746 |
|
} |
| 747 |
|
} |
| 748 |
|
if (!skip_folder && !exists("../GameDataFolder/IGMD/" + dir_itr->path().filename() + "/ignore.txt")) { |