| 1 |
|
/* |
| 2 |
< |
AE/Mod Installer |
| 3 |
< |
by Gumby and Iritscen |
| 2 |
> |
AE/Mod Installer |
| 3 |
> |
by Gumby and Iritscen |
| 4 |
|
*/ |
| 5 |
|
|
| 6 |
< |
// To-do: - |
| 6 |
> |
// To-do: - Load credits from text resource file |
| 7 |
|
// - Institute lots of checks into file-handling |
| 8 |
< |
// - Clear mod info fields when mod is de-selected ??? |
| 8 |
> |
// - Clear mod info fields when mod is de-selected |
| 9 |
|
|
| 10 |
|
#define DEBUG |
| 11 |
|
#include <stdio.h> |
| 30 |
|
#include <dirent.h> |
| 31 |
|
#endif |
| 32 |
|
|
| 33 |
< |
const string strInstallerVersion = "1.0"; |
| 33 |
> |
//const string strInstallerVersion = "1.0"; |
| 34 |
|
const bool SPLIT = 1; |
| 35 |
|
const bool NOT_SPLIT = 0; |
| 36 |
|
bool splitInstances = SPLIT; |
| 37 |
< |
|
| 37 |
> |
bool busy = 0; |
| 38 |
|
#ifdef WIN32 |
| 39 |
|
const string strOniSplit = "Onisplit.exe"; |
| 40 |
|
string strImportOption = "-import:nosep"; |
| 60 |
|
|
| 61 |
|
int globalizeData(void) |
| 62 |
|
{ |
| 63 |
< |
using boost::lexical_cast; |
| 64 |
< |
using boost::bad_lexical_cast; |
| 65 |
< |
// using namespace boost::posix_time; |
| 63 |
> |
busy = 1; |
| 64 |
> |
using boost::lexical_cast; |
| 65 |
> |
using boost::bad_lexical_cast; |
| 66 |
> |
// using namespace boost::posix_time; |
| 67 |
|
using namespace boost::gregorian; |
| 68 |
|
using namespace boost::posix_time; |
| 69 |
|
ptime start_time(second_clock::local_time()); |
| 77 |
|
ofstream logfile("Globalize.log"); |
| 78 |
|
logfile << "Globalization started " << to_simple_string(start_time) << endl; |
| 79 |
|
try { |
| 80 |
< |
|
| 80 |
> |
|
| 81 |
|
char levels_cstr[15][3] = {"0", "1", "2", "3", "4", "6", "8", "9", "10", "11", "12", "13", "14", "18", "19"}; // the levels Oni has...probably should have made a string array. Oops. |
| 82 |
|
//const vector<double> ck(cv, &cv[CvSize]); |
| 83 |
|
vector<string> levels; |
| 96 |
|
path Animations = "../GameDataFolder/level0_Animations"; |
| 97 |
|
path TRAC = Animations / "level0_TRAC"; |
| 98 |
|
path TRAM = Animations / "level0_TRAM"; |
| 99 |
< |
|
| 99 |
> |
|
| 100 |
|
vector<path> GDFPaths; |
| 101 |
|
GDFPaths.push_back(Characters); |
| 102 |
|
GDFPaths.push_back(Particles); |
| 104 |
|
GDFPaths.push_back(Sounds); |
| 105 |
|
GDFPaths.push_back(TRAC); |
| 106 |
|
GDFPaths.push_back(TRAM); |
| 107 |
< |
|
| 108 |
< |
|
| 107 |
> |
|
| 108 |
> |
|
| 109 |
|
path VanillaCharacters = "packages/VanillaDats/level0_Final/level0_Characters/level0_Characters.oni"; |
| 110 |
|
path VanillaParticles = "packages/VanillaDats/level0_Final/level0_Particles/level0_Particles.oni"; |
| 111 |
|
path VanillaTextures = "packages/VanillaDats/level0_Final/level0_Textures/level0_Textures.oni"; |
| 115 |
|
path VanillaTRAM = "packages/VanillaDats/level0_Final/level0_Animations/level0_TRAM.oni"; |
| 116 |
|
|
| 117 |
|
vector<path> VanillaPaths; |
| 118 |
< |
|
| 118 |
> |
|
| 119 |
|
VanillaPaths.push_back(VanillaCharacters); |
| 120 |
|
VanillaPaths.push_back(VanillaParticles); |
| 121 |
|
VanillaPaths.push_back(VanillaTextures); |
| 122 |
|
VanillaPaths.push_back(VanillaSounds); |
| 123 |
|
VanillaPaths.push_back(VanillaTRAC); |
| 124 |
|
VanillaPaths.push_back(VanillaTRAM); |
| 125 |
< |
|
| 125 |
> |
|
| 126 |
|
/* |
| 127 |
|
if (exists("../GameDataFolder/")) |
| 128 |
|
{ |
| 143 |
|
setStatusArea("Creating needed directories..."); |
| 144 |
|
logfile << "Creating needed directories...\n"; |
| 145 |
|
create_directory( "../GameDataFolder/" ); |
| 146 |
< |
|
| 146 |
> |
|
| 147 |
|
create_directory( "packages" ); |
| 148 |
< |
|
| 148 |
> |
|
| 149 |
|
if (exists("packages/VanillaDats")) remove_all("packages/VanillaDats"); |
| 150 |
|
create_directory( "packages/VanillaDats" ); |
| 151 |
< |
|
| 151 |
> |
|
| 152 |
|
create_directory( "packages/VanillaDats/level0_Final/" ); |
| 153 |
|
//blah blah finish this. |
| 154 |
|
//logfile << "packages/VanillaDats/level0_Final/ created"; |
| 163 |
|
int num_levels = 0; |
| 164 |
|
for(int i = 1; i < 15; i++) |
| 165 |
|
{ |
| 166 |
< |
if (exists("../../GameDataFolder/level" + levels[i] + "_Final.dat")) { |
| 166 |
> |
if (exists("../../GameDataFolder/level" + levels[i] + "_Final.dat")) { |
| 167 |
|
num_levels++; |
| 168 |
|
|
| 169 |
|
} |
| 172 |
|
int total_steps = 8 + 2 * num_levels; |
| 173 |
|
for(int i = 0; i < 15; i++) |
| 174 |
|
{ |
| 175 |
< |
|
| 175 |
> |
|
| 176 |
|
//printf(levels[i],"%d",levels[i]); // int to char array |
| 177 |
< |
|
| 177 |
> |
|
| 178 |
|
if (exists("../../GameDataFolder/level" + levels[i] + "_Final.dat")) { |
| 179 |
|
logfile << "level" << levels[i] << "_Final\n"; |
| 180 |
|
logfile << "\tExporting level" << levels[i] << "_Final.dat\n"; |
| 181 |
|
//printf(Step_x_x,"Step %d/%d: exporting level%d_final.dat", parts_done + 1,, levels[i]); setStatusArea((string)Step_x_x); |
| 182 |
|
setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + " exporting level" + levels[i]+"_Final.dat"); |
| 183 |
|
create_directory( "../GameDataFolder/level" + levels[i] + "_Final" ); |
| 184 |
< |
// setStatusArea(strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat"); |
| 184 |
> |
// setStatusArea(strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat"); |
| 185 |
|
system((strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat").c_str()); |
| 186 |
|
create_directory( "packages/VanillaDats/level" + levels[i] + "_Final" ); |
| 187 |
|
create_directory( "packages/VanillaDats/level" + levels[i] + "_Final/level" + levels[i] + "_Final" ); |
| 257 |
|
else if (dir_itr->path().filename().substr(0,4) == "AGDB" |
| 258 |
|
|| dir_itr->path().filename().substr(0,4) == "TRCM") { |
| 259 |
|
cout <<dir_itr->path().filename() << "\n"; |
| 260 |
< |
|
| 260 |
> |
|
| 261 |
|
if(!exists( Archive / dir_itr->filename())) rename(dir_itr->path(), Archive / dir_itr->filename()); |
| 262 |
|
else remove(dir_itr->path()); |
| 263 |
|
} |
| 265 |
|
|
| 266 |
|
} |
| 267 |
|
else { |
| 268 |
< |
logfile << "\tMoved file: " << dir_itr->path().filename() << "\n"; |
| 268 |
> |
//logfile << "\tMoved file: " << dir_itr->path().filename() << "\n"; |
| 269 |
|
} |
| 270 |
|
} |
| 271 |
|
|
| 272 |
|
|
| 273 |
< |
|
| 273 |
> |
|
| 274 |
|
} |
| 275 |
|
logfile << "\tCleaning up TXMPs...\n"; |
| 276 |
|
system( (strOniSplit + " -move:delete " + Textures.string() + " ../GameDataFolder/level" + levels[i] + "_Final/TXMP*.oni").c_str()); |
| 277 |
|
parts_done++; |
| 278 |
|
|
| 279 |
|
setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) )); |
| 280 |
< |
|
| 280 |
> |
|
| 281 |
|
} |
| 282 |
|
} |
| 283 |
|
logfile << "Reimporting levels\n"; |
| 288 |
|
//printf(Step_x_x,"Step %d/%d: reimporting level", parts_done + 1, 7 + 2 * num_levels); setStatusArea((string)Step_x_x + levels[i] + (string)"_Final.dat"); |
| 289 |
|
setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + " reimporting level" + levels[i]+"_Final.oni"); |
| 290 |
|
system( (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level" |
| 291 |
< |
+ levels[i] + "_Final/level" + levels[i] + "_Final.oni > Globalize.oni").c_str()); |
| 291 |
> |
+ levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize.log").c_str()); |
| 292 |
|
setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) )); |
| 293 |
< |
parts_done++; |
| 293 |
> |
parts_done++; |
| 294 |
|
} |
| 295 |
|
create_directory( VanillaCharacters.parent_path() ); |
| 296 |
|
create_directory( VanillaParticles.parent_path() ); |
| 297 |
|
create_directory( VanillaTextures.parent_path() ); |
| 298 |
|
create_directory( VanillaSounds.parent_path() ); |
| 299 |
|
create_directory( VanillaAnimations.remove_filename() ); |
| 300 |
< |
|
| 300 |
> |
|
| 301 |
|
for(int j = 0; j < GDFPaths.size(); j++) { |
| 302 |
|
logfile << "\tReimporting " << GDFPaths[j].filename() << ".oni\n"; |
| 303 |
< |
setStatusArea("Step" + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + ": reimporting " + GDFPaths[j].filename() ); |
| 303 |
> |
setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + ": reimporting " + GDFPaths[j].filename() ); |
| 304 |
|
system((strOniSplit + " " + strImportOption + " " + GDFPaths[j].string() + " " + VanillaPaths[j].string()).c_str()); |
| 305 |
|
parts_done++; |
| 306 |
|
setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) )); |
| 307 |
|
} |
| 308 |
< |
/* |
| 308 |
> |
/* |
| 309 |
|
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) )); |
| 310 |
|
system((strOniSplit + " " + strImportOption + " " + Characters.string() + " " + VanillaCharacters.string()).c_str()); |
| 311 |
|
parts_done++; printf(Step_x_x,"Step %d/%d: reimporting level0_Particles", parts_done,7 + 2 * num_levels); setStatusArea((string)Step_x_x);setProgressBar( (int)(1000 * (float)(parts_done) / (float)(7 + 2 * num_levels) )); |
| 321 |
|
system((strOniSplit + " " + strImportOption + " " + TRAM.string() + " " + VanillaTRAM.string()).c_str()); |
| 322 |
|
//parts_done++; setStatusArea((string)"Copying level scripts...");setProgressBar( (int)(1000 * (float)(parts_done) / (float)(7 + 2 * num_levels) )); |
| 323 |
|
if (exists("../GameDataFolder/IGMD")) remove_all("../GameDataFolder/IGMD"); |
| 324 |
< |
*/ |
| 324 |
> |
*/ |
| 325 |
|
create_directory((path)"../GameDataFolder/IGMD"); |
| 326 |
< |
copy((path)"packages/VanillaBSL/", (path)"../GameDataFolder"); |
| 327 |
< |
setProgressBar( 1000 ); |
| 328 |
< |
setStatusArea((string)"Done! Now select your mod packages and click install."); |
| 329 |
< |
// while(1) Sleep(-1); |
| 326 |
> |
copy((path)"packages/VanillaBSL/IGMD", (path)"../GameDataFolder"); |
| 327 |
> |
setProgressBar( 1000 ); |
| 328 |
> |
|
| 329 |
> |
// CIP:last of all, set up the edition folder as a playable Oni installation by placing the latest application (+ Daodan DLL on Windows) in edition/ |
| 330 |
|
|
| 331 |
+ |
// CIP:then copy persist.dat and keyconfig.txt into edition/ as well |
| 332 |
+ |
|
| 333 |
+ |
#ifndef WIN32 |
| 334 |
+ |
/* On Mac only, set the current GDF to the AE GDF by writing to Oni's global preferences file (thankfully a standard OS X ".plist" XML file). |
| 335 |
+ |
If there are no Oni prefs (only possible if Oni has not been run even once), then the above line will fail silently, no harm done, |
| 336 |
+ |
and when the user does run Oni for the first time, using the copy of the app in the AE GDF, Oni will set the prefs to use that GDF at that point */ |
| 337 |
+ |
path fullAEpath = system_complete("."); // get full path for Installer |
| 338 |
+ |
char prefsCommand[300] = "defaults write com.godgames.oni RetailInstallationPath -string '"; |
| 339 |
+ |
strcat(prefsCommand, fullAEpath.parent_path().parent_path().string().c_str()); // get path of edition/ folder (Oni wants the folder that *contains* the GDF) |
| 340 |
+ |
strcat(prefsCommand, "'"); // path string is enclosed in single quotes to avoid the need to escape UNIX-unfriendly characters |
| 341 |
+ |
system(prefsCommand); |
| 342 |
+ |
|
| 343 |
+ |
#endif |
| 344 |
+ |
|
| 345 |
+ |
setStatusArea((string)"Done! Now select your mod packages and click install."); |
| 346 |
+ |
// while(1) Sleep(-1); |
| 347 |
+ |
|
| 348 |
|
} |
| 349 |
|
catch (exception ex) { |
| 350 |
|
setStatusArea("Warning, handled exception: " + (string)ex.what()); |
| 351 |
|
} |
| 334 |
– |
|
| 335 |
– |
ptime end_time(second_clock::local_time()); |
| 336 |
– |
time_period total_time (start_time, end_time); |
| 337 |
– |
logfile << "\n\nGlobalization ended " << to_simple_string(end_time) << "\nThe process took " << total_time.length(); |
| 338 |
– |
//total_time.length().hours(); |
| 339 |
– |
logfile.close(); |
| 352 |
|
|
| 353 |
+ |
ptime end_time(second_clock::local_time()); |
| 354 |
+ |
time_period total_time (start_time, end_time); |
| 355 |
+ |
logfile << "\n\nGlobalization ended " << to_simple_string(end_time) << "\nThe process took " << total_time.length(); |
| 356 |
+ |
//total_time.length().hours(); |
| 357 |
+ |
logfile.close(); |
| 358 |
+ |
busy = 0; |
| 359 |
|
return err; |
| 360 |
|
} |
| 361 |
|
|
| 508 |
|
|
| 509 |
|
void recompileAll(vector<string> installedMods) |
| 510 |
|
{ |
| 511 |
+ |
busy = 1; |
| 512 |
|
using namespace boost::gregorian; |
| 513 |
|
using namespace boost::posix_time; |
| 514 |
+ |
using boost::lexical_cast; |
| 515 |
+ |
using boost::bad_lexical_cast; |
| 516 |
|
|
| 517 |
|
setStatusArea("Importing levels..."); |
| 518 |
|
//setStatusArea("Recompiling Data..."); |
| 571 |
|
} |
| 572 |
|
importCommand += " ../GameDataFolder/" + dir_itr->path().filename() + ".dat >> Install.log"; |
| 573 |
|
|
| 574 |
< |
printf(statusString,"%d/%i\0",j,numberOfDats); |
| 574 |
> |
|
| 575 |
|
setProgressBar( (int)(1000 * (float)(j-1) / (float)numberOfDats) ); //100% * dat we're on / total dats |
| 576 |
< |
setStatusArea("Importing " + dir_itr->path().filename() + " " + statusString); |
| 576 |
> |
setStatusArea("Step " + lexical_cast<std::string>(j) + '/' + lexical_cast<std::string>(numberOfDats)+ ": Importing " + dir_itr->path().filename() + " "); |
| 577 |
|
|
| 578 |
|
system(importCommand.c_str()); |
| 579 |
|
//Sleep(1000); |
| 584 |
|
} |
| 585 |
|
catch ( const std::exception & ex ) |
| 586 |
|
{ |
| 587 |
< |
|
| 588 |
< |
remove("Install.log"); |
| 589 |
< |
ofstream logfile("Install.log"); |
| 590 |
< |
|
| 591 |
< |
|
| 587 |
> |
|
| 588 |
> |
remove("Install.log"); |
| 589 |
> |
ofstream logfile("Install.log"); |
| 590 |
> |
|
| 591 |
> |
|
| 592 |
|
logfile << "Warning, exception " << ex.what() << "!"; |
| 593 |
|
setStatusArea("Warning, exception " + (string)ex.what() + "!"); |
| 594 |
< |
logfile.close(); |
| 594 |
> |
logfile.close(); |
| 595 |
|
} |
| 596 |
|
} |
| 597 |
|
|
| 598 |
|
} |
| 599 |
|
catch( const std::exception & ex ) { |
| 600 |
< |
|
| 601 |
< |
remove("Install.log"); |
| 602 |
< |
ofstream logfile("Install.log"); |
| 603 |
< |
|
| 604 |
< |
|
| 605 |
< |
logfile << "Warning, exception " << ex.what() << "!"; |
| 606 |
< |
setStatusArea("Warning, exception " + (string)ex.what() + "!"); |
| 607 |
< |
logfile.close(); |
| 600 |
> |
|
| 601 |
> |
remove("Install.log"); |
| 602 |
> |
ofstream logfile("Install.log"); |
| 603 |
> |
|
| 604 |
> |
|
| 605 |
> |
logfile << "Warning, exception " << ex.what() << "!"; |
| 606 |
> |
setStatusArea("Warning, exception " + (string)ex.what() + "!"); |
| 607 |
> |
logfile.close(); |
| 608 |
|
} |
| 609 |
|
|
| 610 |
|
} |
| 643 |
|
} |
| 644 |
|
importCommand += " ../GameDataFolder/" + dir_itr->path().filename() + ".dat >> Install.log"; |
| 645 |
|
|
| 646 |
< |
printf(statusString,"%d/%i\0",j,numberOfDats); |
| 646 |
> |
|
| 647 |
|
setProgressBar( (int)(1000 * (float)(j-1) / (float)numberOfDats) ); //100% * dat we're on / total dats |
| 648 |
< |
setStatusArea("Importing " + dir_itr->path().filename() + " " + statusString); |
| 648 |
> |
setStatusArea("Step " + lexical_cast<std::string>(j) + '/' + lexical_cast<std::string>(numberOfDats)+ ": Importing " + dir_itr->path().filename() + " "); |
| 649 |
|
|
| 650 |
|
system(importCommand.c_str()); |
| 651 |
|
|
| 654 |
|
} |
| 655 |
|
catch ( const std::exception & ex ) |
| 656 |
|
{ |
| 657 |
< |
|
| 658 |
< |
remove("Install.log"); |
| 659 |
< |
ofstream logfile("Install.log"); |
| 660 |
< |
|
| 661 |
< |
|
| 662 |
< |
logfile << "Warning, exception " << ex.what() << "!"; |
| 663 |
< |
setStatusArea("Warning, exception " + (string)ex.what() + "!"); |
| 664 |
< |
logfile.close(); |
| 657 |
> |
|
| 658 |
> |
remove("Install.log"); |
| 659 |
> |
ofstream logfile("Install.log"); |
| 660 |
> |
|
| 661 |
> |
|
| 662 |
> |
logfile << "Warning, exception " << ex.what() << "!"; |
| 663 |
> |
setStatusArea("Warning, exception " + (string)ex.what() + "!"); |
| 664 |
> |
logfile.close(); |
| 665 |
|
}} |
| 666 |
|
} |
| 667 |
|
logfile << "Writing config file"; |
| 668 |
|
writeInstalledMods(installedMods); |
| 669 |
|
setProgressBar(1000); |
| 670 |
|
setStatusArea("Done! You can now play Oni."); |
| 650 |
– |
|
| 651 |
– |
ptime end_time(second_clock::local_time()); |
| 652 |
– |
time_period total_time (start_time, end_time); |
| 653 |
– |
|
| 654 |
– |
|
| 655 |
– |
ofstream logfile2("Install.log", ios::app | ios::ate); |
| 656 |
– |
string outstring = (string)"\n\nGlobalization ended " + to_simple_string(end_time) + "\nThe process took ";// + (string)total_time.length(); |
| 657 |
– |
|
| 658 |
– |
logfile2 << "\nGlobalization ended " << to_simple_string(end_time) << "\nThe process took " << total_time.length(); |
| 659 |
– |
|
| 660 |
– |
//logfile2.write(outstring.c_str(), outstring.length()); |
| 661 |
– |
logfile2.close(); |
| 671 |
|
|
| 672 |
< |
//total_time.length().hours(); |
| 673 |
< |
|
| 672 |
> |
ptime end_time(second_clock::local_time()); |
| 673 |
> |
time_period total_time (start_time, end_time); |
| 674 |
> |
|
| 675 |
> |
|
| 676 |
> |
ofstream logfile2("Install.log", ios::app | ios::ate); |
| 677 |
> |
string outstring = (string)"\n\nGlobalization ended " + to_simple_string(end_time) + "\nThe process took ";// + (string)total_time.length(); |
| 678 |
> |
|
| 679 |
> |
logfile2 << "\nGlobalization ended " << to_simple_string(end_time) << "\nThe process took " << total_time.length(); |
| 680 |
> |
|
| 681 |
> |
//logfile2.write(outstring.c_str(), outstring.length()); |
| 682 |
> |
logfile2.close(); |
| 683 |
> |
|
| 684 |
> |
//total_time.length().hours(); |
| 685 |
> |
|
| 686 |
|
Sleep(1000); |
| 687 |
|
setProgressBar(0); |
| 688 |
+ |
busy = 0; |
| 689 |
|
} |
| 690 |
|
|
| 691 |
|
void writeInstalledMods(vector<string> installedMods) |
| 890 |
|
CreateControls(); |
| 891 |
|
SetIcon(GetIconResource(wxT("oni_special.ico"))); |
| 892 |
|
Centre(); |
| 893 |
< |
|
| 894 |
< |
|
| 893 |
> |
|
| 894 |
> |
|
| 895 |
|
////@end MainWindow creation |
| 896 |
|
return true; |
| 897 |
|
} |
| 979 |
|
itemMenu44->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL); |
| 980 |
|
menuBar->Append(itemMenu44, _("Help")); |
| 981 |
|
itemFrame1->SetMenuBar(menuBar); |
| 982 |
< |
|
| 982 |
> |
|
| 983 |
|
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); |
| 984 |
|
itemFrame1->SetSizer(itemBoxSizer2); |
| 985 |
|
|
| 1137 |
|
|
| 1138 |
|
if(strImportOption == "-import:nosep") NoSepRadio->SetValue(true); |
| 1139 |
|
else SepRadio->SetValue(true); |
| 1140 |
< |
|
| 1141 |
< |
|
| 1140 |
> |
|
| 1141 |
> |
|
| 1142 |
|
#ifdef WIN32 |
| 1143 |
|
RedirectIOToConsole(); |
| 1144 |
|
HWND hWnd = GetConsoleWindow(); |
| 1145 |
|
ShowWindow( hWnd, SW_HIDE ); |
| 1146 |
|
#endif |
| 1147 |
< |
|
| 1148 |
< |
//MainWindow::SetSize(MainWindow::GetRect().GetWidth(), MainWindow::GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight() ); |
| 1147 |
> |
|
| 1148 |
> |
//MainWindow::SetSize(MainWindow::GetRect().GetWidth(), MainWindow::GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight() ); |
| 1149 |
|
} |
| 1150 |
|
|
| 1151 |
|
|
| 1239 |
|
wxUnusedVar(name); |
| 1240 |
|
if (name == _T("oni_special.ico")) |
| 1241 |
|
{ |
| 1242 |
< |
// wxIcon icon(_T("oni_special.ico"), wxBITMAP_TYPE_ICO); |
| 1243 |
< |
// return icon; |
| 1242 |
> |
// wxIcon icon(_T("oni_special.ico"), wxBITMAP_TYPE_ICO); |
| 1243 |
> |
// return icon; |
| 1244 |
|
} |
| 1245 |
|
return wxNullIcon; |
| 1246 |
|
////@end MainWindow icon retrieval |
| 1290 |
|
|
| 1291 |
|
void MainWindow::OnOptionsClick( wxCommandEvent& event ) |
| 1292 |
|
{ |
| 1271 |
– |
|
| 1272 |
– |
|
| 1273 |
– |
|
| 1274 |
– |
|
| 1293 |
|
if (!event.GetInt() ) { |
| 1294 |
|
OptionsPanel->Hide(); |
| 1295 |
< |
MainWindow::SetSize(MainWindow::GetRect().GetWidth(), MainWindow::GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight());} |
| 1295 |
> |
this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight());} |
| 1296 |
|
else { |
| 1297 |
< |
//Uncomment this when we release, it gets annoying if you are testing globalization a lot ;) |
| 1298 |
< |
//wxMessageDialog* YesNoDialog = new wxMessageDialog(this, "WARNING: These options are for advanced users only, use with caution.", "AE Installer Alert", wxOK | wxICON_EXCLAMATION , wxDefaultPosition); |
| 1299 |
< |
//YesNoDialog->ShowModal(); |
| 1297 |
> |
// Uncomment this when we release, it gets annoying if you are testing globalization a lot ;) |
| 1298 |
> |
wxMessageDialog* YesNoDialog = new wxMessageDialog(this, "WARNING: These options are for advanced users only, use with caution.", |
| 1299 |
> |
"AE Installer Alert", wxOK | wxICON_EXCLAMATION , wxDefaultPosition); |
| 1300 |
> |
YesNoDialog->ShowModal(); |
| 1301 |
|
OptionsPanel->Show(); |
| 1302 |
< |
MainWindow::SetSize(MainWindow::GetRect().GetWidth(), MainWindow::GetRect().GetHeight()+OptionsPanel->GetRect().GetHeight()); |
| 1302 |
> |
this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()+OptionsPanel->GetRect().GetHeight()+1); |
| 1303 |
> |
this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()-1); |
| 1304 |
|
} |
| 1305 |
|
} |
| 1306 |
|
|
| 1340 |
|
localPackages.push_back("Globalize"); |
| 1341 |
|
for(int i = 0; i < globalPackages.size(); i++) if(Mods_CheckboxList->IsChecked(i)) localPackages.push_back( globalPackages[i].modStringName ); |
| 1342 |
|
if ( !localPackages.empty() ) { |
| 1343 |
< |
|
| 1343 |
> |
|
| 1344 |
|
//MainWindow::MainWindow().Hide(); |
| 1345 |
|
// boost::thread thrd2(recompileAll(localPackages) ); |
| 1346 |
|
//MainWindow::MainWindow().Show(); |
| 1347 |
+ |
this->InstallButton->Disable(); |
| 1348 |
+ |
this->ReglobalizeButton->Disable(); |
| 1349 |
|
#ifdef WIN32 |
| 1350 |
|
recompile packages(localPackages); |
| 1351 |
|
boost::thread thrd(packages); |
| 1352 |
|
#else |
| 1331 |
– |
this->Disable(); |
| 1353 |
|
recompileAll(localPackages); |
| 1333 |
– |
this->Enable(); |
| 1354 |
|
#endif |
| 1355 |
|
|
| 1356 |
+ |
this->InstallButton->Enable(); |
| 1357 |
+ |
this->ReglobalizeButton->Enable(); |
| 1358 |
|
} |
| 1359 |
|
|
| 1360 |
|
|
| 1481 |
|
|
| 1482 |
|
void MainWindow::OnLoadClick( wxCommandEvent& event ) |
| 1483 |
|
{ |
| 1484 |
+ |
if (busy == 1) return; |
| 1485 |
|
static const wxChar *FILETYPES = _T( |
| 1486 |
|
"Mod Loadouts (*.cfg)|*.cfg|" |
| 1487 |
|
"All files (*.*)|*.*" |
| 1506 |
|
|
| 1507 |
|
void MainWindow::OnSaveClick( wxCommandEvent& event ) |
| 1508 |
|
{ |
| 1509 |
+ |
if (busy == 1) return; |
| 1510 |
|
static const wxChar *FILETYPES = _T( |
| 1511 |
|
"Mod Loadouts (*.cfg)|*.cfg|" |
| 1512 |
|
"All files (*.*)|*.*" |
| 1562 |
|
|
| 1563 |
|
void MainWindow::OnReGlobalizeButtonClick( wxCommandEvent& event ) |
| 1564 |
|
{ |
| 1565 |
< |
wxMessageDialog* YesNoDialog = new wxMessageDialog(this, "WARNING: This will DELETE the Edition's GameDataFolder and reglobalize all of your data. \n Are you SURE you want to do this? ", "AE Installer Alert", wxYES_NO | wxICON_EXCLAMATION , wxDefaultPosition); |
| 1565 |
> |
wxMessageDialog* YesNoDialog = new wxMessageDialog(this, "WARNING: This will DELETE the Edition's GameDataFolder and recreate it from the vanilla Oni game data. \n Are you SURE you want to do this? ", "AE Installer Alert", wxYES_NO | wxICON_EXCLAMATION , wxDefaultPosition); |
| 1566 |
|
|
| 1567 |
|
if (YesNoDialog->ShowModal() == wxID_NO) { //if the user said no... |
| 1568 |
< |
|
| 1568 |
> |
|
| 1569 |
|
} |
| 1570 |
|
else { |
| 1547 |
– |
|
| 1571 |
|
|
| 1572 |
+ |
this->InstallButton->Disable(); |
| 1573 |
+ |
this->ReglobalizeButton->Disable(); |
| 1574 |
|
|
| 1575 |
|
#ifdef WIN32 |
| 1576 |
|
|
| 1577 |
< |
boost::thread thrd2(globalizeData); |
| 1578 |
< |
//globalizeData(); |
| 1579 |
< |
//boost::thread::create_thread(&globalizeData); |
| 1580 |
< |
// boost::thread_group Tg; |
| 1581 |
< |
// Tg.create_thread( &globalizeData(), this ); |
| 1577 |
> |
boost::thread thrd2(globalizeData); |
| 1578 |
> |
//globalizeData(); |
| 1579 |
> |
//boost::thread::create_thread(&globalizeData); |
| 1580 |
> |
// boost::thread_group Tg; |
| 1581 |
> |
// Tg.create_thread( &globalizeData(), this ); |
| 1582 |
|
#else |
| 1583 |
< |
globalizeData(); |
| 1559 |
< |
setProgressBar(1000); |
| 1560 |
< |
setStatusArea("Done!"); |
| 1583 |
> |
globalizeData(); |
| 1584 |
|
#endif |
| 1585 |
< |
} |
| 1585 |
> |
|
| 1586 |
> |
this->InstallButton->Enable(); |
| 1587 |
> |
this->ReglobalizeButton->Enable(); |
| 1588 |
> |
} |
| 1589 |
|
|
| 1590 |
|
} |
| 1591 |
|
/* |