362 |
|
copy((path)"packages/VanillaBSL/IGMD", (path)"../GameDataFolder"); |
363 |
|
setProgressBar( 1000 ); |
364 |
|
|
365 |
< |
if(!exists("../persist.dat")) |
365 |
> |
if(exists("../../persist.dat")) if(!exists("../persist.dat")) |
366 |
|
copy("../../persist.dat",".."); |
367 |
< |
if(!exists("../key_config.txt")) |
367 |
> |
if(exists("../../key_config.txt"))if(!exists("../key_config.txt")) |
368 |
|
copy("../../key_config.txt",".."); |
369 |
|
|
370 |
|
#ifndef WIN32 |
545 |
|
} |
546 |
|
|
547 |
|
void recompileAll(vector<string> installedMods) |
548 |
< |
{ |
548 |
> |
{try { |
549 |
|
busy = 1; |
550 |
|
using namespace boost::gregorian; |
551 |
|
using namespace boost::posix_time; |
552 |
|
using boost::lexical_cast; |
553 |
|
using boost::bad_lexical_cast; |
554 |
< |
|
555 |
< |
setStatusArea("Importing levels..."); |
556 |
< |
//setStatusArea("Recompiling Data..."); |
557 |
< |
path vanilla_dir = "./VanillaDats/"; |
554 |
> |
path vanilla_dir = "./VanillaDats/"; |
555 |
|
string importCommand = ""; |
556 |
|
char statusString[128]; |
557 |
|
int numberOfDats = 0; |
558 |
|
int j = 1; |
559 |
|
string datString; |
560 |
+ |
|
561 |
+ |
|
562 |
+ |
setStatusArea("Importing levels..."); |
563 |
+ |
//setStatusArea("Recompiling Data..."); |
564 |
+ |
|
565 |
|
std::stringstream out; |
566 |
|
|
567 |
|
ptime start_time(second_clock::local_time()); |
568 |
|
clearOldDats(); |
569 |
< |
remove("Install.log"); |
569 |
> |
|
570 |
> |
if(exists("Install.log")) remove("Install.log"); |
571 |
|
ofstream logfile("Install.log"); |
572 |
|
logfile << "Mod Installation started " << to_simple_string(start_time) << endl; |
573 |
|
logfile.close(); |
574 |
+ |
|
575 |
+ |
|
576 |
|
if(splitInstances == SPLIT){ |
577 |
|
recursive_directory_iterator end_iter; |
578 |
|
|
586 |
|
numberOfDats++; |
587 |
|
} |
588 |
|
} |
589 |
< |
catch(exception ex) { |
589 |
> |
catch(exception & ex) { |
590 |
> |
remove("Install.log"); |
591 |
> |
ofstream logfile("Install.log"); |
592 |
> |
|
593 |
|
|
594 |
+ |
logfile << "Warning, exception " << ex.what() << "!"; |
595 |
+ |
setStatusArea("Warning, exception " + (string)ex.what() + "!"); |
596 |
+ |
logfile.close(); |
597 |
|
} |
598 |
|
} |
599 |
|
try { |
600 |
|
//recursive_directory_iterator end_iter; |
601 |
< |
|
601 |
> |
|
602 |
|
|
603 |
|
out << numberOfDats; |
604 |
|
datString = out.str(); |
732 |
|
|
733 |
|
Sleep(1000); |
734 |
|
setProgressBar(0); |
735 |
< |
busy = 0; |
735 |
> |
|
736 |
> |
} |
737 |
> |
catch(exception & ex) { |
738 |
> |
remove("Install.log"); |
739 |
> |
ofstream logfile("Install.log"); |
740 |
> |
|
741 |
> |
|
742 |
> |
logfile << "Warning, exception " << ex.what() << "!"; |
743 |
> |
setStatusArea("Warning, exception " + (string)ex.what() + "!"); |
744 |
> |
logfile.close(); |
745 |
> |
} |
746 |
> |
busy = 0; |
747 |
|
} |
748 |
|
|
749 |
+ |
|
750 |
|
void writeInstalledMods(vector<string> installedMods) |
751 |
|
{ |
752 |
|
|
1414 |
|
TheInstallButton->Disable(); |
1415 |
|
recompileAll(thePackages); |
1416 |
|
TheInstallButton->Enable(); |
1417 |
+ |
|
1418 |
|
} |
1419 |
|
|
1420 |
|
vector<string> thePackages; |
1421 |
|
}; |
1422 |
|
|
1423 |
+ |
void globalize2(void) { |
1424 |
+ |
TheInstallButton->Disable(); |
1425 |
+ |
globalizeData(); |
1426 |
+ |
TheInstallButton->Enable(); |
1427 |
+ |
} |
1428 |
+ |
|
1429 |
+ |
|
1430 |
+ |
|
1431 |
|
void MainWindow::OnInstallButtonClick( wxCommandEvent& event ) |
1432 |
|
{ |
1433 |
|
|
1434 |
|
vector<string> localPackages; |
1435 |
< |
localPackages.push_back("Globalize"); |
1435 |
> |
localPackages.push_back("00000Globalize"); |
1436 |
|
for(int i = 0; i < globalPackages.size(); i++) if(Mods_CheckboxList->IsChecked(i)) localPackages.push_back( globalPackages[i].modStringName ); |
1437 |
|
if ( !localPackages.empty() ) { |
1438 |
< |
|
1438 |
> |
sort(localPackages.begin(), localPackages.end()); |
1439 |
> |
localPackages[0] = "Globalize"; |
1440 |
|
//MainWindow::MainWindow().Hide(); |
1441 |
|
// boost::thread thrd2(recompileAll(localPackages) ); |
1442 |
|
//MainWindow::MainWindow().Show(); |