| 42 |
|
#include <dirent.h> |
| 43 |
|
#endif |
| 44 |
|
|
| 45 |
< |
//const string strInstallerVersion = "1.0"; |
| 45 |
> |
|
| 46 |
|
const bool SPLIT = 1; |
| 47 |
|
const bool NOT_SPLIT = 0; |
| 48 |
|
bool splitInstances = SPLIT; |
| 121 |
|
path TRAM = Animations / "level0_TRAM"; |
| 122 |
|
|
| 123 |
|
vector<path> GDFPaths; |
| 124 |
< |
GDFPaths.push_back(Characters); |
| 124 |
> |
//GDFPaths.push_back(Characters); |
| 125 |
|
GDFPaths.push_back(Particles); |
| 126 |
|
GDFPaths.push_back(Textures); |
| 127 |
|
GDFPaths.push_back(Sounds); |
| 139 |
|
|
| 140 |
|
vector<path> VanillaPaths; |
| 141 |
|
|
| 142 |
< |
VanillaPaths.push_back(VanillaCharacters); |
| 142 |
> |
//VanillaPaths.push_back(VanillaCharacters); |
| 143 |
|
VanillaPaths.push_back(VanillaParticles); |
| 144 |
|
VanillaPaths.push_back(VanillaTextures); |
| 145 |
|
VanillaPaths.push_back(VanillaSounds); |
| 229 |
|
else remove(dir_itr->path()); |
| 230 |
|
} |
| 231 |
|
else if (dir_itr->path().filename().substr(0,4) == "TRAC" |
| 232 |
< |
|| dir_itr->path().filename().substr(0,4) == "ONVL") { |
| 232 |
> |
) { |
| 233 |
|
cout <<dir_itr->path().filename() << "\n"; |
| 234 |
|
if(!exists( TRAC / dir_itr->filename())) rename(dir_itr->path(), TRAC / dir_itr->filename()); |
| 235 |
|
else remove(dir_itr->path()); |
| 249 |
|
else if (dir_itr->path().filename().substr(0,4) == "ONCC" |
| 250 |
|
|| dir_itr->path().filename().substr(0,4) == "TRBS" |
| 251 |
|
|| dir_itr->path().filename().substr(0,4) == "ONCV" |
| 252 |
+ |
|| dir_itr->path().filename().substr(0,4) == "ONVL" |
| 253 |
|
|| dir_itr->path().filename().substr(0,4) == "TRMA" |
| 254 |
|
|| dir_itr->path().filename().substr(0,4) == "TRSC" |
| 255 |
|
|| dir_itr->path().filename().substr(0,4) == "TRAS") { |
| 290 |
|
if(!exists( "VanillaDats/level0_Final/level0_Final/" + dir_itr->filename())) rename(dir_itr->path(), "VanillaDats/level0_Final/level0_Final/" + dir_itr->filename()); |
| 291 |
|
else remove(dir_itr->path()); |
| 292 |
|
} |
| 293 |
+ |
|
| 294 |
|
if (exists(dir_itr->path())) { |
| 295 |
|
|
| 296 |
|
} |
| 320 |
|
logfile << (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final VanillaDats/level" + levels[i] + "_Final/level" |
| 321 |
|
+ levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize.log").c_str() << '\n'; |
| 322 |
|
string sys_str = (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final VanillaDats/level" + levels[i] + "_Final/level" |
| 323 |
< |
+ levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize.log"); |
| 323 |
> |
+ levels[i] + "_Final/level" + levels[i] + "_Final.oni"); |
| 324 |
|
system(sys_str.c_str() ); |
| 325 |
|
setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) )); |
| 326 |
|
parts_done++; |
| 327 |
|
} |
| 328 |
< |
create_directory( VanillaCharacters.parent_path() ); |
| 328 |
> |
//create_directory( VanillaCharacters.parent_path() ); |
| 329 |
|
create_directory( VanillaParticles.parent_path() ); |
| 330 |
|
create_directory( VanillaTextures.parent_path() ); |
| 331 |
|
create_directory( VanillaSounds.parent_path() ); |
| 338 |
|
parts_done++; |
| 339 |
|
setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) )); |
| 340 |
|
} |
| 341 |
+ |
logfile << "\nMoving level0_Characters\n"; |
| 342 |
+ |
setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + ": moving level0_Characters" ); |
| 343 |
+ |
copy((path)"../GameDataFolder/level0_Characters", (path)("VanillaDats/level0_Final")); |
| 344 |
|
/* |
| 345 |
|
printf(Step_x_x,"Step %d/%d: reimporting level0_Characters", parts_done,7 + 2 * num_levels); setStatusArea((string)Step_x_x);setProgressBar( (int)(1000 * (float)(parts_done) / (float)(7 + 2 * num_levels) )); |
| 346 |
|
system((strOniSplit + " " + strImportOption + " " + Characters.string() + " " + VanillaCharacters.string()).c_str()); |
| 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 |
< |
|
| 550 |
< |
setStatusArea("Importing levels..."); |
| 551 |
< |
//setStatusArea("Recompiling Data..."); |
| 552 |
< |
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 |
|
|
| 1103 |
|
StatusArea = new wxStatusBar( itemFrame1, ID_STATUSBAR, 0 ); |
| 1104 |
|
StatusArea->SetName(_T("StatusArea")); |
| 1105 |
|
StatusArea->SetFieldsCount(1); |
| 1106 |
< |
StatusArea->SetStatusText(_("AE Installer v1.0"), 0); |
| 1106 |
> |
StatusArea->SetStatusText(_("AE Installer v1.0.1"), 0); |
| 1107 |
|
itemBoxSizer2->Add(StatusArea, 0, wxGROW|wxALL, 0); |
| 1108 |
|
|
| 1109 |
|
wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL); |
| 1174 |
|
::CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_ITaskbarList, (void **)&pTaskbarList); |
| 1175 |
|
#endif |
| 1176 |
|
|
| 1177 |
+ |
|
| 1178 |
|
/*if ( exists( "../../GameDataFolder/level0_Final.sep" ) ) { |
| 1179 |
|
strImportOption = "-import:sep"; |
| 1180 |
|
splitInstances = NOT_SPLIT; |
| 1184 |
|
splitInstances = SPLIT; |
| 1185 |
|
}*/ |
| 1186 |
|
|
| 1187 |
+ |
|
| 1188 |
+ |
#ifndef WIN32 |
| 1189 |
+ |
strImportOption = "-import:sep"; |
| 1190 |
+ |
splitInstances = NOT_SPLIT; |
| 1191 |
+ |
#else |
| 1192 |
+ |
strImportOption = "-import:nosep"; |
| 1193 |
+ |
splitInstances = SPLIT; |
| 1194 |
+ |
#endif |
| 1195 |
+ |
|
| 1196 |
|
#ifndef WIN32 |
| 1197 |
|
strImportOption = "-import:sep"; |
| 1198 |
|
splitInstances = NOT_SPLIT; |
| 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(); |