| 1 |
+ |
#ifndef NTDDI_VERSION |
| 2 |
+ |
#define NTDDI_VERSION NTDDI_WIN7 |
| 3 |
+ |
#endif |
| 4 |
+ |
#ifdef WIN32 |
| 5 |
+ |
#include <windows.h> |
| 6 |
+ |
#include <shobjidl.h> |
| 7 |
+ |
HWND Handle; |
| 8 |
+ |
|
| 9 |
+ |
ITaskbarList *pTaskbarList; |
| 10 |
+ |
ITaskbarList3 *pTaskbarList3; |
| 11 |
+ |
#endif |
| 12 |
+ |
|
| 13 |
|
/* |
| 14 |
< |
AE/Mod Installer |
| 15 |
< |
by Gumby and Iritscen |
| 14 |
> |
AE/Mod Installer |
| 15 |
> |
by Gumby and Iritscen |
| 16 |
|
*/ |
| 17 |
|
|
| 18 |
|
// To-do: - Load credits from text resource file |
| 7 |
– |
// - Version number in credits should be universalized |
| 19 |
|
// - Institute lots of checks into file-handling |
| 20 |
|
// - Clear mod info fields when mod is de-selected |
| 21 |
|
|
| 33 |
|
|
| 34 |
|
#include "boost/filesystem.hpp" // includes all needed Boost.Filesystem declarations |
| 35 |
|
#include "boost/lexical_cast.hpp" //int -> string |
| 36 |
+ |
#include "boost/algorithm/string.hpp" |
| 37 |
|
#include "installer.h" |
| 38 |
|
|
| 39 |
|
#ifdef WIN32 |
| 43 |
|
#include <dirent.h> |
| 44 |
|
#endif |
| 45 |
|
|
| 46 |
< |
const string strInstallerVersion = "1.0"; |
| 46 |
> |
|
| 47 |
|
const bool SPLIT = 1; |
| 48 |
|
const bool NOT_SPLIT = 0; |
| 49 |
|
bool splitInstances = SPLIT; |
| 65 |
|
using namespace std; |
| 66 |
|
|
| 67 |
|
|
| 68 |
+ |
vector<string> globalInstalledMods; |
| 69 |
+ |
vector<ModPackage> globalPackages; |
| 70 |
|
|
| 71 |
|
|
| 72 |
|
#include "boost/date_time/gregorian/gregorian.hpp" |
| 73 |
|
#include "boost/date_time/date_parsing.hpp" |
| 74 |
|
#include "boost/date_time/posix_time/posix_time.hpp" |
| 75 |
|
|
| 76 |
+ |
string escapePath(string input) { |
| 77 |
+ |
|
| 78 |
+ |
string output; |
| 79 |
+ |
string escape_me = "& ;()|<>\"'\\#*?$"; |
| 80 |
+ |
for(unsigned int i = 0; i < input.size(); i++) { |
| 81 |
+ |
for(unsigned int j = 0; j < escape_me.size(); j++) if (input[i] == escape_me[j]) output += '\\'; |
| 82 |
+ |
output += input[i]; |
| 83 |
+ |
} |
| 84 |
+ |
return output; |
| 85 |
+ |
} |
| 86 |
+ |
|
| 87 |
|
int globalizeData(void) |
| 88 |
|
{ |
| 89 |
|
busy = 1; |
| 124 |
|
path TRAM = Animations / "level0_TRAM"; |
| 125 |
|
|
| 126 |
|
vector<path> GDFPaths; |
| 127 |
< |
GDFPaths.push_back(Characters); |
| 127 |
> |
//GDFPaths.push_back(Characters); |
| 128 |
|
GDFPaths.push_back(Particles); |
| 129 |
|
GDFPaths.push_back(Textures); |
| 130 |
|
GDFPaths.push_back(Sounds); |
| 132 |
|
GDFPaths.push_back(TRAM); |
| 133 |
|
|
| 134 |
|
|
| 135 |
< |
path VanillaCharacters = "packages/VanillaDats/level0_Final/level0_Characters/level0_Characters.oni"; |
| 136 |
< |
path VanillaParticles = "packages/VanillaDats/level0_Final/level0_Particles/level0_Particles.oni"; |
| 137 |
< |
path VanillaTextures = "packages/VanillaDats/level0_Final/level0_Textures/level0_Textures.oni"; |
| 138 |
< |
path VanillaSounds = "packages/VanillaDats/level0_Final/level0_Sounds/level0_Sounds.oni"; |
| 139 |
< |
path VanillaAnimations = "packages/VanillaDats/level0_Final/level0_Animations/level0_Animations.oni"; |
| 140 |
< |
path VanillaTRAC = "packages/VanillaDats/level0_Final/level0_Animations/level0_TRAC.oni"; |
| 141 |
< |
path VanillaTRAM = "packages/VanillaDats/level0_Final/level0_Animations/level0_TRAM.oni"; |
| 135 |
> |
path VanillaCharacters = "VanillaDats/level0_Final/level0_Characters/level0_Characters.oni"; |
| 136 |
> |
path VanillaParticles = "VanillaDats/level0_Final/level0_Particles/level0_Particles.oni"; |
| 137 |
> |
path VanillaTextures = "VanillaDats/level0_Final/level0_Textures/level0_Textures.oni"; |
| 138 |
> |
path VanillaSounds = "VanillaDats/level0_Final/level0_Sounds/level0_Sounds.oni"; |
| 139 |
> |
path VanillaAnimations = "VanillaDats/level0_Final/level0_Animations/level0_Animations.oni"; |
| 140 |
> |
path VanillaTRAC = "VanillaDats/level0_Final/level0_Animations/level0_TRAC.oni"; |
| 141 |
> |
path VanillaTRAM = "VanillaDats/level0_Final/level0_Animations/level0_TRAM.oni"; |
| 142 |
|
|
| 143 |
|
vector<path> VanillaPaths; |
| 144 |
|
|
| 145 |
< |
VanillaPaths.push_back(VanillaCharacters); |
| 145 |
> |
//VanillaPaths.push_back(VanillaCharacters); |
| 146 |
|
VanillaPaths.push_back(VanillaParticles); |
| 147 |
|
VanillaPaths.push_back(VanillaTextures); |
| 148 |
|
VanillaPaths.push_back(VanillaSounds); |
| 172 |
|
|
| 173 |
|
create_directory( "packages" ); |
| 174 |
|
|
| 175 |
< |
if (exists("packages/VanillaDats")) remove_all("packages/VanillaDats"); |
| 176 |
< |
create_directory( "packages/VanillaDats" ); |
| 177 |
< |
|
| 153 |
< |
create_directory( "packages/VanillaDats/level0_Final/" ); |
| 175 |
> |
if (exists("VanillaDats")) remove_all("VanillaDats"); |
| 176 |
> |
create_directory( "VanillaDats" ); |
| 177 |
> |
create_directory( "VanillaDats/level0_Final/" ); |
| 178 |
|
//blah blah finish this. |
| 179 |
< |
//logfile << "packages/VanillaDats/level0_Final/ created"; |
| 179 |
> |
//logfile << "VanillaDats/level0_Final/ created"; |
| 180 |
|
create_directory( Characters ); |
| 181 |
|
create_directory( Particles ); |
| 182 |
|
create_directory( Archive ); |
| 208 |
|
create_directory( "../GameDataFolder/level" + levels[i] + "_Final" ); |
| 209 |
|
// setStatusArea(strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat"); |
| 210 |
|
system((strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat").c_str()); |
| 211 |
< |
create_directory( "packages/VanillaDats/level" + levels[i] + "_Final" ); |
| 212 |
< |
create_directory( "packages/VanillaDats/level" + levels[i] + "_Final/level" + levels[i] + "_Final" ); |
| 211 |
> |
create_directory( "VanillaDats/level" + levels[i] + "_Final" ); |
| 212 |
> |
create_directory( "VanillaDats/level" + levels[i] + "_Final/level" + levels[i] + "_Final" ); |
| 213 |
|
|
| 214 |
|
directory_iterator end_iter; |
| 215 |
|
for ( directory_iterator dir_itr( "../GameDataFolder/level" + levels[i] + "_Final" ); dir_itr != end_iter; ++dir_itr ) |
| 232 |
|
else remove(dir_itr->path()); |
| 233 |
|
} |
| 234 |
|
else if (dir_itr->path().filename().substr(0,4) == "TRAC" |
| 235 |
< |
|| dir_itr->path().filename().substr(0,4) == "ONVL") { |
| 235 |
> |
) { |
| 236 |
|
cout <<dir_itr->path().filename() << "\n"; |
| 237 |
|
if(!exists( TRAC / dir_itr->filename())) rename(dir_itr->path(), TRAC / dir_itr->filename()); |
| 238 |
|
else remove(dir_itr->path()); |
| 252 |
|
else if (dir_itr->path().filename().substr(0,4) == "ONCC" |
| 253 |
|
|| dir_itr->path().filename().substr(0,4) == "TRBS" |
| 254 |
|
|| dir_itr->path().filename().substr(0,4) == "ONCV" |
| 255 |
+ |
|| dir_itr->path().filename().substr(0,4) == "ONVL" |
| 256 |
|
|| dir_itr->path().filename().substr(0,4) == "TRMA" |
| 257 |
|
|| dir_itr->path().filename().substr(0,4) == "TRSC" |
| 258 |
|
|| dir_itr->path().filename().substr(0,4) == "TRAS") { |
| 287 |
|
if(!exists( Archive / dir_itr->filename())) rename(dir_itr->path(), Archive / dir_itr->filename()); |
| 288 |
|
else remove(dir_itr->path()); |
| 289 |
|
} |
| 290 |
+ |
else if (dir_itr->path().filename().substr(0,4) == "ONWC") { //fix for buggy ONWC overriding |
| 291 |
+ |
cout <<dir_itr->path().filename() << "\n"; |
| 292 |
+ |
|
| 293 |
+ |
if(!exists( "VanillaDats/level0_Final/level0_Final/" + dir_itr->filename())) rename(dir_itr->path(), "VanillaDats/level0_Final/level0_Final/" + dir_itr->filename()); |
| 294 |
+ |
else remove(dir_itr->path()); |
| 295 |
+ |
} |
| 296 |
+ |
|
| 297 |
|
if (exists(dir_itr->path())) { |
| 298 |
|
|
| 299 |
|
} |
| 320 |
|
//printf(levels[i],"%d",levels[i]); |
| 321 |
|
//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"); |
| 322 |
|
setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + " reimporting level" + levels[i]+"_Final.oni"); |
| 323 |
< |
system( (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level" |
| 324 |
< |
+ levels[i] + "_Final/level" + levels[i] + "_Final.oni > Globalize.log").c_str()); |
| 323 |
> |
logfile << (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final VanillaDats/level" + levels[i] + "_Final/level" |
| 324 |
> |
+ levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize.log").c_str() << '\n'; |
| 325 |
> |
string sys_str = (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final VanillaDats/level" + levels[i] + "_Final/level" |
| 326 |
> |
+ levels[i] + "_Final/level" + levels[i] + "_Final.oni"); |
| 327 |
> |
system(sys_str.c_str() ); |
| 328 |
|
setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) )); |
| 329 |
|
parts_done++; |
| 330 |
|
} |
| 331 |
< |
create_directory( VanillaCharacters.parent_path() ); |
| 331 |
> |
//create_directory( VanillaCharacters.parent_path() ); |
| 332 |
|
create_directory( VanillaParticles.parent_path() ); |
| 333 |
|
create_directory( VanillaTextures.parent_path() ); |
| 334 |
|
create_directory( VanillaSounds.parent_path() ); |
| 335 |
|
create_directory( VanillaAnimations.remove_filename() ); |
| 336 |
|
|
| 337 |
< |
for(int j = 0; j < GDFPaths.size(); j++) { |
| 337 |
> |
for(unsigned int j = 0; j < GDFPaths.size(); j++) { |
| 338 |
|
logfile << "\tReimporting " << GDFPaths[j].filename() << ".oni\n"; |
| 339 |
|
setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + ": reimporting " + GDFPaths[j].filename() ); |
| 340 |
|
system((strOniSplit + " " + strImportOption + " " + GDFPaths[j].string() + " " + VanillaPaths[j].string()).c_str()); |
| 341 |
|
parts_done++; |
| 342 |
|
setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) )); |
| 343 |
|
} |
| 344 |
+ |
logfile << "\nMoving level0_Characters\n"; |
| 345 |
+ |
setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + ": moving level0_Characters" ); |
| 346 |
+ |
copy((path)"../GameDataFolder/level0_Characters", (path)("VanillaDats/level0_Final")); |
| 347 |
|
/* |
| 348 |
|
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) )); |
| 349 |
|
system((strOniSplit + " " + strImportOption + " " + Characters.string() + " " + VanillaCharacters.string()).c_str()); |
| 363 |
|
*/ |
| 364 |
|
create_directory((path)"../GameDataFolder/IGMD"); |
| 365 |
|
copy((path)"packages/VanillaBSL/IGMD", (path)"../GameDataFolder"); |
| 366 |
< |
setProgressBar( 1000 ); |
| 366 |
> |
setProgressBar( 1000 ); |
| 367 |
> |
|
| 368 |
> |
if(exists("../../persist.dat")) if(!exists("../persist.dat")) |
| 369 |
> |
copy("../../persist.dat",".."); |
| 370 |
> |
if(exists("../../key_config.txt"))if(!exists("../key_config.txt")) |
| 371 |
> |
copy("../../key_config.txt",".."); |
| 372 |
> |
|
| 373 |
> |
#ifndef WIN32 |
| 374 |
> |
/* 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). |
| 375 |
> |
Tests for presence of prefs with [ -f ] before doing anything so it doesn't create a partial prefs file -- just in case user has never |
| 376 |
> |
run Oni before :-p */ |
| 377 |
> |
string fullAEpath = escapePath(system_complete(".").parent_path().parent_path().string()); // get full path for edition/ |
| 378 |
> |
char prefsCommand[300] = "[ -f ~/Library/Preferences/com.godgames.oni.plist ] && defaults write com.godgames.oni RetailInstallationPath -string '"; |
| 379 |
> |
strcat(prefsCommand, fullAEpath.c_str()); // get path of edition/ folder (Oni wants the folder that *contains* the GDF) |
| 380 |
> |
strcat(prefsCommand, "'"); // path string is enclosed in single quotes to avoid the need to escape UNIX-unfriendly characters |
| 381 |
> |
system(prefsCommand); |
| 382 |
> |
|
| 383 |
> |
#endif |
| 384 |
> |
|
| 385 |
> |
|
| 386 |
|
setStatusArea((string)"Done! Now select your mod packages and click install."); |
| 387 |
|
// while(1) Sleep(-1); |
| 388 |
|
|
| 389 |
|
} |
| 390 |
< |
catch (exception ex) { |
| 390 |
> |
catch (exception & ex) { |
| 391 |
|
setStatusArea("Warning, handled exception: " + (string)ex.what()); |
| 392 |
|
} |
| 393 |
|
|
| 411 |
|
|
| 412 |
|
try |
| 413 |
|
{ |
| 414 |
< |
directory_iterator end_iter; |
| 358 |
< |
for (directory_iterator dir_itr("./packages"); dir_itr != end_iter; ++dir_itr) |
| 414 |
> |
for (directory_iterator dir_itr("./packages"), end_itr; dir_itr != end_itr; ++dir_itr) |
| 415 |
|
{ |
| 416 |
|
file.open((dir_itr->path().string() + "/" + MODINFO_CFG).c_str()); |
| 417 |
|
//cout << filename << "\n"; |
| 490 |
|
} |
| 491 |
|
else if (!HasOnis.compare(*iter)) { |
| 492 |
|
iter++; iter++; |
| 493 |
< |
if (toupper((*iter)[0]) + toupper((*iter)[1]) + toupper((*iter)[2]) == 'Y' + 'E' + 'S') package.hasOnis = 1; //Gotta love c++'s lack of a standard case-insensitive |
| 494 |
< |
else if (!HasBSL.compare(*iter)) { // string comparer...I know my implementation here sucks. I need to change it to check each character one by one. At the moment, |
| 495 |
< |
iter++; iter++;} // using "YFR" would probably set it off. :< |
| 496 |
< |
|
| 497 |
< |
if (toupper((*iter)[0]) + toupper((*iter)[1]) + toupper((*iter)[2]) == 'Y' + 'E' + 'S') package.hasBSL = 1; |
| 493 |
> |
if ( boost::iequals(*iter, "Yes")) package.hasOnis = 1; |
| 494 |
> |
} |
| 495 |
> |
else if (!HasBSL.compare(*iter)) { // string comparer...I know my implementation here sucks. I need to change it to check each character one by one. At the moment, |
| 496 |
> |
iter++; iter++; // using "YFR" would probably set it off. :< |
| 497 |
> |
if ( boost::iequals(*iter, "Yes")) package.hasBSL = 1; |
| 498 |
> |
else if ( boost::iequals(*iter, "Addon")) package.hasAddon = 1; |
| 499 |
|
} |
| 500 |
|
else if (!HasDeltas.compare(*iter)) { |
| 501 |
|
iter++; iter++; |
| 521 |
|
//cout << " "; |
| 522 |
|
package.category += *iter + " "; |
| 523 |
|
} |
| 467 |
– |
} |
| 524 |
|
} |
| 525 |
< |
else if (!Creator.compare(*iter)) { //if it contains the name |
| 526 |
< |
for ( ; iter !=tokens.end() && SLASHSLASH.compare(*iter); iter++) { //interates through the words, ends if it reaches the end of the line or a "//" comment |
| 527 |
< |
if (ARROW.compare(*iter) && Creator.compare(*iter)) { //ignores "->" and "Category" |
| 528 |
< |
//cout << *iter; |
| 529 |
< |
//cout << " "; |
| 530 |
< |
package.creator += *iter + " "; |
| 531 |
< |
} |
| 525 |
> |
} |
| 526 |
> |
else if (!Creator.compare(*iter)) { //if it contains the name |
| 527 |
> |
for ( ; iter !=tokens.end() && SLASHSLASH.compare(*iter); iter++) { //interates through the words, ends if it reaches the end of the line or a "//" comment |
| 528 |
> |
if (ARROW.compare(*iter) && Creator.compare(*iter)) { //ignores "->" and "Category" |
| 529 |
> |
//cout << *iter; |
| 530 |
> |
//cout << " "; |
| 531 |
> |
package.creator += *iter + " "; |
| 532 |
|
} |
| 533 |
|
} |
| 534 |
< |
else if (!Readme.compare(*iter)) { //if it contains the name |
| 535 |
< |
for ( ; iter !=tokens.end() && SLASHSLASH.compare(*iter); iter++) { //interates through the words, ends if it reaches the end of the line or a "//" comment |
| 536 |
< |
if (ARROW.compare(*iter) && Readme.compare(*iter)) { //ignores "->" and "Category" |
| 537 |
< |
if(!(*iter).compare("\\n")) package.readme += '\n'; |
| 538 |
< |
else package.readme += *iter + " "; |
| 539 |
< |
} |
| 534 |
> |
} |
| 535 |
> |
else if (!Readme.compare(*iter)) { //if it contains the name |
| 536 |
> |
for ( ; iter !=tokens.end() && SLASHSLASH.compare(*iter); iter++) { //interates through the words, ends if it reaches the end of the line or a "//" comment |
| 537 |
> |
if (ARROW.compare(*iter) && Readme.compare(*iter)) { //ignores "->" and "Category" |
| 538 |
> |
if(!(*iter).compare("\\n")) package.readme += '\n'; |
| 539 |
> |
else package.readme += *iter + " "; |
| 540 |
|
} |
| 541 |
|
} |
| 542 |
|
} |
| 487 |
– |
|
| 543 |
|
} |
| 544 |
< |
package.doOutput(); |
| 545 |
< |
return package; |
| 544 |
> |
|
| 545 |
> |
} |
| 546 |
> |
package.doOutput(); |
| 547 |
> |
return package; |
| 548 |
|
} |
| 549 |
|
|
| 550 |
|
void recompileAll(vector<string> installedMods) |
| 551 |
< |
{ |
| 551 |
> |
{try { |
| 552 |
|
busy = 1; |
| 553 |
|
using namespace boost::gregorian; |
| 554 |
|
using namespace boost::posix_time; |
| 555 |
|
using boost::lexical_cast; |
| 556 |
|
using boost::bad_lexical_cast; |
| 557 |
< |
|
| 501 |
< |
setStatusArea("Importing levels..."); |
| 502 |
< |
//setStatusArea("Recompiling Data..."); |
| 503 |
< |
path vanilla_dir = "./packages/VanillaDats/"; |
| 557 |
> |
path vanilla_dir = "./VanillaDats/"; |
| 558 |
|
string importCommand = ""; |
| 559 |
|
char statusString[128]; |
| 560 |
|
int numberOfDats = 0; |
| 561 |
|
int j = 1; |
| 562 |
|
string datString; |
| 563 |
+ |
|
| 564 |
+ |
|
| 565 |
+ |
setStatusArea("Importing levels..."); |
| 566 |
+ |
//setStatusArea("Recompiling Data..."); |
| 567 |
+ |
|
| 568 |
|
std::stringstream out; |
| 569 |
|
|
| 570 |
|
ptime start_time(second_clock::local_time()); |
| 571 |
|
clearOldDats(); |
| 572 |
< |
remove("Install.log"); |
| 572 |
> |
|
| 573 |
> |
if(exists("Install.log")) remove("Install.log"); |
| 574 |
|
ofstream logfile("Install.log"); |
| 575 |
|
logfile << "Mod Installation started " << to_simple_string(start_time) << endl; |
| 576 |
|
logfile.close(); |
| 577 |
+ |
|
| 578 |
+ |
|
| 579 |
|
if(splitInstances == SPLIT){ |
| 580 |
|
recursive_directory_iterator end_iter; |
| 581 |
|
|
| 589 |
|
numberOfDats++; |
| 590 |
|
} |
| 591 |
|
} |
| 592 |
< |
catch(exception ex) { |
| 592 |
> |
catch(exception & ex) { |
| 593 |
> |
remove("Install.log"); |
| 594 |
> |
ofstream logfile("Install.log"); |
| 595 |
|
|
| 596 |
+ |
|
| 597 |
+ |
logfile << "Warning, exception " << ex.what() << "!"; |
| 598 |
+ |
setStatusArea("Warning, exception " + (string)ex.what() + "!"); |
| 599 |
+ |
logfile.close(); |
| 600 |
|
} |
| 601 |
|
} |
| 602 |
< |
|
| 602 |
> |
try { |
| 603 |
|
//recursive_directory_iterator end_iter; |
| 604 |
< |
|
| 604 |
> |
|
| 605 |
|
|
| 606 |
|
out << numberOfDats; |
| 607 |
|
datString = out.str(); |
| 540 |
– |
try { |
| 608 |
|
for ( recursive_directory_iterator dir_itr( vanilla_dir ); |
| 609 |
|
dir_itr != end_iter; |
| 610 |
|
++dir_itr ) |
| 614 |
|
if ( is_directory( dir_itr->status() ) && dir_itr.level() == 1) |
| 615 |
|
{ |
| 616 |
|
importCommand = strOniSplit + " " + strImportOption + " " + dir_itr->path().parent_path().string() + '/' + dir_itr->path().filename(); |
| 617 |
< |
for (int i = 0; i < installedMods.size(); ++i) { |
| 617 |
> |
for (unsigned int i = 0; i < installedMods.size(); ++i) { |
| 618 |
|
if (exists("packages/" + installedMods[i] + "/oni/" + dir_itr->path().parent_path().filename() + '/' + dir_itr->path().filename() )) |
| 619 |
|
importCommand += " packages/" + installedMods[i] + "/oni/" + dir_itr->path().parent_path().filename() + '/' + dir_itr->path().filename(); |
| 620 |
|
|
| 621 |
< |
//else cout << " packages/VanillaDats/" + installedMods[i] + "/oni/"; |
| 621 |
> |
//else cout << " VanillaDats/" + installedMods[i] + "/oni/"; |
| 622 |
|
} |
| 623 |
|
importCommand += " ../GameDataFolder/" + dir_itr->path().filename() + ".dat >> Install.log"; |
| 624 |
|
|
| 686 |
|
{ |
| 687 |
|
if ( is_directory( dir_itr->status() ) ) |
| 688 |
|
{ |
| 689 |
< |
importCommand = strOniSplit + " " + strImportOption + " " + vanilla_dir.string() + dir_itr->path().filename() + " " + "../GameDataFolder/" + dir_itr->path().filename() |
| 690 |
< |
+ ".dat"; |
| 624 |
< |
for (int i = 0; i < installedMods.size(); ++i) { |
| 689 |
> |
importCommand = strOniSplit + " " + strImportOption + " " + vanilla_dir.string() + dir_itr->path().filename() + " "; |
| 690 |
> |
for (unsigned int i = 0; i < installedMods.size(); ++i) { |
| 691 |
|
if (exists("packages/" + installedMods[i] + "/oni/" + dir_itr->path().filename() )) |
| 692 |
|
importCommand += " packages/" + installedMods[i] + "/oni/" + dir_itr->path().filename(); |
| 693 |
|
} |
| 714 |
|
logfile.close(); |
| 715 |
|
}} |
| 716 |
|
} |
| 717 |
+ |
|
| 718 |
+ |
|
| 719 |
+ |
|
| 720 |
+ |
|
| 721 |
+ |
|
| 722 |
+ |
|
| 723 |
+ |
|
| 724 |
+ |
|
| 725 |
+ |
ofstream BSLlog("BSL.log"); |
| 726 |
+ |
|
| 727 |
+ |
vector<string> BSLfolders; |
| 728 |
+ |
vector<string> skippedfolders; |
| 729 |
+ |
|
| 730 |
+ |
|
| 731 |
+ |
|
| 732 |
+ |
for ( directory_iterator dir_itr( "../GameDataFolder/IGMD/" ), end_itr; |
| 733 |
+ |
dir_itr != end_itr; |
| 734 |
+ |
++dir_itr ) { |
| 735 |
+ |
if( exists(dir_itr->path().string() + "/ignore.txt") ){ |
| 736 |
+ |
BSLfolders.push_back(dir_itr->path().filename()); |
| 737 |
+ |
skippedfolders.push_back(dir_itr->path().filename()); |
| 738 |
+ |
} |
| 739 |
+ |
} |
| 740 |
+ |
|
| 741 |
+ |
for (int i = installedMods.size() - 1; i >= 0; i--) { //Iterates through the installed mods (backwards :P) |
| 742 |
+ |
for (unsigned int j = 0; j < globalPackages.size(); ++j) { //looking in the global packages |
| 743 |
+ |
if (globalPackages[j].modStringName == installedMods[i]) { //for a mod that has BSL in it |
| 744 |
+ |
BSLlog << "Testing " << globalPackages[j].modStringName << "\n" |
| 745 |
+ |
<< "HasBSL: " << globalPackages[j].hasBSL << "\n" |
| 746 |
+ |
<< "HasAddon: " << globalPackages[j].hasAddon << "\n"; |
| 747 |
+ |
if(!(globalPackages[j].hasAddon || globalPackages[j].hasBSL)) break; //skip non-BSL |
| 748 |
+ |
if( exists( "packages/" + globalPackages[j].modStringName + "/BSL" ) ) |
| 749 |
+ |
copyBSL("packages/" + globalPackages[j].modStringName + "/BSL", BSLfolders, globalPackages[j] ); |
| 750 |
+ |
} |
| 751 |
+ |
|
| 752 |
+ |
} |
| 753 |
+ |
} |
| 754 |
+ |
|
| 755 |
+ |
ModPackage emptyPackage; |
| 756 |
+ |
copyBSL("packages/VanillaBSL/IGMD", BSLfolders, emptyPackage); |
| 757 |
+ |
BSLlog.close(); |
| 758 |
+ |
|
| 759 |
+ |
|
| 760 |
|
logfile << "Writing config file"; |
| 761 |
|
writeInstalledMods(installedMods); |
| 762 |
|
setProgressBar(1000); |
| 763 |
< |
setStatusArea("Done! You can now play Oni."); |
| 763 |
> |
|
| 764 |
> |
string finallyDone = "Done! You can now play Oni."; |
| 765 |
> |
|
| 766 |
> |
a |
| 767 |
> |
|
| 768 |
> |
setStatusArea(finallyDone); |
| 769 |
|
|
| 770 |
|
ptime end_time(second_clock::local_time()); |
| 771 |
|
time_period total_time (start_time, end_time); |
| 774 |
|
ofstream logfile2("Install.log", ios::app | ios::ate); |
| 775 |
|
string outstring = (string)"\n\nGlobalization ended " + to_simple_string(end_time) + "\nThe process took ";// + (string)total_time.length(); |
| 776 |
|
|
| 777 |
< |
logfile2 << "\nGlobalization ended " << to_simple_string(end_time) << "\nThe process took " << total_time.length(); |
| 777 |
> |
logfile2 << "\nInstallation ended " << to_simple_string(end_time) << "\nThe process took " << total_time.length(); |
| 778 |
|
|
| 779 |
|
//logfile2.write(outstring.c_str(), outstring.length()); |
| 780 |
|
logfile2.close(); |
| 783 |
|
|
| 784 |
|
Sleep(1000); |
| 785 |
|
setProgressBar(0); |
| 786 |
+ |
|
| 787 |
+ |
} |
| 788 |
+ |
catch(exception & ex) { |
| 789 |
+ |
remove("Install.log"); //why did we do this? :| |
| 790 |
+ |
ofstream logfile("Install.log"); |
| 791 |
+ |
|
| 792 |
+ |
|
| 793 |
+ |
logfile << "Warning, exception " << ex.what() << "!"; |
| 794 |
+ |
setStatusArea("Warning, exception " + (string)ex.what() + "!"); |
| 795 |
+ |
logfile.close(); |
| 796 |
+ |
} |
| 797 |
|
busy = 0; |
| 798 |
|
} |
| 799 |
|
|
| 800 |
+ |
void copyBSL(string copypath, vector<string> BSLfolders, ModPackage pkg) { |
| 801 |
+ |
try { |
| 802 |
+ |
for ( directory_iterator dir_itr( copypath ), end_itr; |
| 803 |
+ |
dir_itr != end_itr; |
| 804 |
+ |
++dir_itr ) { |
| 805 |
+ |
|
| 806 |
+ |
if ( is_directory( dir_itr->path() ) && dir_itr->path().string() != ".svn" ) { |
| 807 |
+ |
int skip_folder = 0; |
| 808 |
+ |
for(unsigned int k = 0; k < BSLfolders.size(); k++) {//iterate through already found BSL folders |
| 809 |
+ |
if(dir_itr->path().filename() == BSLfolders[k]) { |
| 810 |
+ |
skip_folder = 1; |
| 811 |
+ |
break; |
| 812 |
+ |
} |
| 813 |
+ |
} |
| 814 |
+ |
if (!skip_folder && !exists("../GameDataFolder/IGMD/" + dir_itr->path().filename() + "/ignore.txt")) { |
| 815 |
+ |
remove_all( "../GameDataFolder/IGMD/" + dir_itr->path().filename() ); |
| 816 |
+ |
Sleep(100); |
| 817 |
+ |
create_directory( "../GameDataFolder/IGMD/" + dir_itr->path().filename()); |
| 818 |
+ |
|
| 819 |
+ |
for ( directory_iterator bsl_itr( dir_itr->path() ); |
| 820 |
+ |
bsl_itr != end_itr; |
| 821 |
+ |
bsl_itr++ ) { |
| 822 |
+ |
if ( bsl_itr->path().extension() == ".bsl" ) { |
| 823 |
+ |
copy_file(bsl_itr->path(), "../GameDataFolder/IGMD/" + dir_itr->path().filename() + "/" + bsl_itr->path().filename()); |
| 824 |
+ |
} |
| 825 |
+ |
} |
| 826 |
+ |
BSLfolders.push_back( dir_itr->path().filename() ); |
| 827 |
+ |
} |
| 828 |
+ |
} |
| 829 |
+ |
} |
| 830 |
+ |
} |
| 831 |
+ |
catch ( const std::exception & ex ) |
| 832 |
+ |
{ |
| 833 |
+ |
setStatusArea("Warning, exception " + (string)ex.what() + "!"); |
| 834 |
+ |
while(1) Sleep(1000); |
| 835 |
+ |
} |
| 836 |
+ |
|
| 837 |
+ |
} |
| 838 |
+ |
|
| 839 |
+ |
|
| 840 |
|
void writeInstalledMods(vector<string> installedMods) |
| 841 |
|
{ |
| 842 |
|
|
| 918 |
|
|
| 919 |
|
} |
| 920 |
|
|
| 756 |
– |
vector<string> globalInstalledMods; |
| 757 |
– |
vector<ModPackage> globalPackages; |
| 921 |
|
#include "boost/thread.hpp" |
| 922 |
|
#include <boost/thread/mutex.hpp> |
| 923 |
|
|
| 944 |
|
#endif |
| 945 |
|
|
| 946 |
|
////@begin includes |
| 947 |
< |
#include "about_window.h" |
| 947 |
> |
#include "about.h" |
| 948 |
|
////@end includes |
| 949 |
|
|
| 950 |
|
#include "main_window.h" |
| 951 |
|
|
| 952 |
|
////@begin XPM images |
| 953 |
< |
#include "redo.xpm" |
| 953 |
> |
#include "aelogosmall.xpm" |
| 954 |
> |
#include "undo.xpm" |
| 955 |
|
#include "fileopen.xpm" |
| 956 |
|
#include "filesaveas.xpm" |
| 957 |
|
#include "quit.xpm" |
| 974 |
|
BEGIN_EVENT_TABLE( MainWindow, wxFrame ) |
| 975 |
|
|
| 976 |
|
////@begin MainWindow event table entries |
| 977 |
< |
EVT_CHECKBOX( SelectAll_Checkbox, MainWindow::OnSelectAllCheckboxClick ) |
| 977 |
> |
EVT_CHECKBOX( SelectAll_Checkbox, MainWindow::OnSelectAllCheckboxClick ) |
| 978 |
|
|
| 979 |
< |
EVT_BUTTON( Refresh_Button, MainWindow::OnRefreshButtonClick ) |
| 979 |
> |
EVT_BUTTON( Refresh_Button, MainWindow::OnRefreshButtonClick ) |
| 980 |
|
|
| 981 |
< |
EVT_LISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Selected ) |
| 982 |
< |
EVT_CHECKLISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Toggled ) |
| 981 |
> |
EVT_LISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Selected ) |
| 982 |
> |
EVT_CHECKLISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Toggled ) |
| 983 |
|
|
| 984 |
< |
EVT_UPDATE_UI( ID_STATUSBAR, MainWindow::OnStatusbarUpdate ) |
| 984 |
> |
EVT_UPDATE_UI( ID_STATUSBAR, MainWindow::OnStatusbarUpdate ) |
| 985 |
|
|
| 986 |
< |
EVT_BUTTON( Install_Button, MainWindow::OnInstallButtonClick ) |
| 986 |
> |
EVT_BUTTON( Install_Button, MainWindow::OnInstallButtonClick ) |
| 987 |
|
|
| 988 |
< |
EVT_RADIOBUTTON( Sep_RadioButton, MainWindow::OnSepRadioButtonSelected ) |
| 988 |
> |
EVT_RADIOBUTTON( Sep_RadioButton, MainWindow::OnSepRadioButtonSelected ) |
| 989 |
|
|
| 990 |
< |
EVT_RADIOBUTTON( NoSep_RadioButton, MainWindow::OnNoSepRadioButtonSelected ) |
| 990 |
> |
EVT_RADIOBUTTON( NoSep_RadioButton, MainWindow::OnNoSepRadioButtonSelected ) |
| 991 |
|
|
| 992 |
< |
EVT_RADIOBUTTON( Separated_RadioButton, MainWindow::OnSeparatedRadioButtonSelected ) |
| 992 |
> |
EVT_RADIOBUTTON( Seperated_RadioButton, MainWindow::OnSeperatedRadioButtonSelected ) |
| 993 |
|
|
| 994 |
< |
EVT_RADIOBUTTON( Complete_RadioButton, MainWindow::OnCompleteRadioButtonSelected ) |
| 994 |
> |
EVT_RADIOBUTTON( Complete_RadioButton, MainWindow::OnCompleteRadioButtonSelected ) |
| 995 |
|
|
| 996 |
< |
EVT_BUTTON( ReGlobalize_Button, MainWindow::OnReGlobalizeButtonClick ) |
| 996 |
> |
EVT_BUTTON( ReGlobalize_Button, MainWindow::OnReGlobalizeButtonClick ) |
| 997 |
|
|
| 998 |
< |
EVT_MENU( wxID_LOAD, MainWindow::OnLoadClick ) |
| 998 |
> |
EVT_MENU( wxID_LOAD, MainWindow::OnLoadClick ) |
| 999 |
|
|
| 1000 |
< |
EVT_MENU( wxID_SAVE, MainWindow::OnSaveClick ) |
| 1000 |
> |
EVT_MENU( wxID_SAVE, MainWindow::OnSaveClick ) |
| 1001 |
|
|
| 1002 |
< |
EVT_MENU( wxID_EXIT, MainWindow::OnExitClick ) |
| 1002 |
> |
EVT_MENU( wxID_EXIT, MainWindow::OnExitClick ) |
| 1003 |
|
|
| 1004 |
< |
EVT_MENU( wxID_OPTIONS, MainWindow::OnOptionsClick ) |
| 1004 |
> |
EVT_MENU( wxID_OPTIONS, MainWindow::OnOptionsClick ) |
| 1005 |
|
|
| 1006 |
< |
EVT_MENU( wxID_ABOUT, MainWindow::OnAboutClick ) |
| 1006 |
> |
EVT_MENU( wxID_ABOUT, MainWindow::OnAboutClick ) |
| 1007 |
|
|
| 1008 |
|
////@end MainWindow event table entries |
| 1009 |
|
|
| 1033 |
|
bool MainWindow::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) |
| 1034 |
|
{ |
| 1035 |
|
////@begin MainWindow creation |
| 1036 |
< |
wxFrame::Create( parent, id, caption, pos, size, style ); |
| 873 |
< |
|
| 874 |
< |
CreateControls(); |
| 875 |
< |
SetIcon(GetIconResource(wxT("oni_special.ico"))); |
| 876 |
< |
Centre(); |
| 877 |
< |
|
| 1036 |
> |
wxFrame::Create( parent, id, caption, pos, size, style ); |
| 1037 |
|
|
| 1038 |
+ |
CreateControls(); |
| 1039 |
+ |
SetIcon(GetIconResource(wxT("aelogosmall.png"))); |
| 1040 |
+ |
Centre(); |
| 1041 |
|
////@end MainWindow creation |
| 1042 |
|
return true; |
| 1043 |
|
} |
| 1061 |
|
void MainWindow::Init() |
| 1062 |
|
{ |
| 1063 |
|
////@begin MainWindow member initialisation |
| 1064 |
< |
MainSplitter = NULL; |
| 1065 |
< |
SelectAll = NULL; |
| 1066 |
< |
RefreshButton = NULL; |
| 1067 |
< |
Mods_CheckboxList = NULL; |
| 1068 |
< |
titleText = NULL; |
| 1069 |
< |
creatorText = NULL; |
| 1070 |
< |
descriptionText = NULL; |
| 1071 |
< |
StatusArea = NULL; |
| 1072 |
< |
ProgressBar = NULL; |
| 1073 |
< |
InstallButton = NULL; |
| 1074 |
< |
OptionsPanel = NULL; |
| 1075 |
< |
SepRadio = NULL; |
| 1076 |
< |
NoSepRadio = NULL; |
| 1077 |
< |
SeparatedRadio = NULL; |
| 1078 |
< |
CompleteRadio = NULL; |
| 1079 |
< |
ReglobalizeButton = NULL; |
| 1064 |
> |
MainSplitter = NULL; |
| 1065 |
> |
SelectAll = NULL; |
| 1066 |
> |
RefreshButton = NULL; |
| 1067 |
> |
Mods_CheckboxList = NULL; |
| 1068 |
> |
titleText = NULL; |
| 1069 |
> |
creatorText = NULL; |
| 1070 |
> |
descriptionText = NULL; |
| 1071 |
> |
StatusArea = NULL; |
| 1072 |
> |
ProgressBar = NULL; |
| 1073 |
> |
InstallButton = NULL; |
| 1074 |
> |
OptionsPanel = NULL; |
| 1075 |
> |
SepRadio = NULL; |
| 1076 |
> |
NoSepRadio = NULL; |
| 1077 |
> |
SeperatedRadio = NULL; |
| 1078 |
> |
CompleteRadio = NULL; |
| 1079 |
> |
ReglobalizeButton = NULL; |
| 1080 |
|
////@end MainWindow member initialisation |
| 1081 |
|
|
| 1082 |
|
} |
| 1091 |
|
void MainWindow::CreateControls() |
| 1092 |
|
{ |
| 1093 |
|
////@begin MainWindow content construction |
| 1094 |
< |
// Generated by DialogBlocks, 31/05/2009 19:03:55 (unregistered) |
| 933 |
< |
|
| 934 |
< |
MainWindow* itemFrame1 = this; |
| 1094 |
> |
MainWindow* itemFrame1 = this; |
| 1095 |
|
|
| 1096 |
< |
wxMenuBar* menuBar = new wxMenuBar; |
| 1097 |
< |
wxMenu* itemMenu37 = new wxMenu; |
| 1098 |
< |
{ |
| 1099 |
< |
wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_LOAD, _("&Load Configuration..."), wxEmptyString, wxITEM_NORMAL); |
| 1100 |
< |
wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("fileopen.xpm"))); |
| 1101 |
< |
menuItem->SetBitmap(bitmap); |
| 1102 |
< |
itemMenu37->Append(menuItem); |
| 1103 |
< |
} |
| 1104 |
< |
{ |
| 1105 |
< |
wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_SAVE, _("&Save Configuration..."), wxEmptyString, wxITEM_NORMAL); |
| 1106 |
< |
wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("filesaveas.xpm"))); |
| 1107 |
< |
menuItem->SetBitmap(bitmap); |
| 1108 |
< |
itemMenu37->Append(menuItem); |
| 1109 |
< |
} |
| 1110 |
< |
itemMenu37->AppendSeparator(); |
| 1111 |
< |
{ |
| 1112 |
< |
wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_EXIT, _("Exit"), wxEmptyString, wxITEM_NORMAL); |
| 1113 |
< |
wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("quit.xpm"))); |
| 1114 |
< |
menuItem->SetBitmap(bitmap); |
| 1115 |
< |
itemMenu37->Append(menuItem); |
| 1116 |
< |
} |
| 1117 |
< |
menuBar->Append(itemMenu37, _("&File")); |
| 1118 |
< |
wxMenu* itemMenu42 = new wxMenu; |
| 1119 |
< |
itemMenu42->Append(wxID_OPTIONS, _("Show Advanced Options..."), wxEmptyString, wxITEM_CHECK); |
| 1120 |
< |
menuBar->Append(itemMenu42, _("Options")); |
| 1121 |
< |
wxMenu* itemMenu44 = new wxMenu; |
| 1122 |
< |
itemMenu44->Append(wxID_HELP, _("Help"), wxEmptyString, wxITEM_NORMAL); |
| 1096 |
> |
wxMenuBar* menuBar = new wxMenuBar; |
| 1097 |
> |
wxMenu* itemMenu37 = new wxMenu; |
| 1098 |
> |
{ |
| 1099 |
> |
wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_LOAD, _("&Load Configuration..."), wxEmptyString, wxITEM_NORMAL); |
| 1100 |
> |
wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("fileopen.xpm"))); |
| 1101 |
> |
menuItem->SetBitmap(bitmap); |
| 1102 |
> |
itemMenu37->Append(menuItem); |
| 1103 |
> |
} |
| 1104 |
> |
{ |
| 1105 |
> |
wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_SAVE, _("&Save Configuration..."), wxEmptyString, wxITEM_NORMAL); |
| 1106 |
> |
wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("filesaveas.xpm"))); |
| 1107 |
> |
menuItem->SetBitmap(bitmap); |
| 1108 |
> |
itemMenu37->Append(menuItem); |
| 1109 |
> |
} |
| 1110 |
> |
itemMenu37->AppendSeparator(); |
| 1111 |
> |
{ |
| 1112 |
> |
wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_EXIT, _("Exit"), wxEmptyString, wxITEM_NORMAL); |
| 1113 |
> |
wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("quit.xpm"))); |
| 1114 |
> |
menuItem->SetBitmap(bitmap); |
| 1115 |
> |
itemMenu37->Append(menuItem); |
| 1116 |
> |
} |
| 1117 |
> |
menuBar->Append(itemMenu37, _("&File")); |
| 1118 |
> |
wxMenu* itemMenu42 = new wxMenu; |
| 1119 |
> |
itemMenu42->Append(wxID_OPTIONS, _("Show Advanced Options..."), wxEmptyString, wxITEM_CHECK); |
| 1120 |
> |
menuBar->Append(itemMenu42, _("Options")); |
| 1121 |
> |
wxMenu* itemMenu44 = new wxMenu; |
| 1122 |
> |
#ifdef WIN32 |
| 1123 |
|
itemMenu44->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL); |
| 1124 |
|
menuBar->Append(itemMenu44, _("Help")); |
| 1125 |
< |
itemFrame1->SetMenuBar(menuBar); |
| 1126 |
< |
|
| 1127 |
< |
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); |
| 1128 |
< |
itemFrame1->SetSizer(itemBoxSizer2); |
| 1125 |
> |
#else |
| 1126 |
> |
itemMenu37->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL); |
| 1127 |
> |
#endif |
| 1128 |
> |
|
| 1129 |
> |
itemFrame1->SetMenuBar(menuBar); |
| 1130 |
|
|
| 1131 |
< |
MainSplitter = new wxSplitterWindow( itemFrame1, ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(100, 100), wxSP_LIVE_UPDATE|wxNO_BORDER ); |
| 1132 |
< |
MainSplitter->SetMinimumPaneSize(150); |
| 972 |
< |
MainSplitter->SetName(_T("MainSplitter")); |
| 973 |
< |
|
| 974 |
< |
wxPanel* itemPanel4 = new wxPanel( MainSplitter, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); |
| 975 |
< |
wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL); |
| 976 |
< |
itemPanel4->SetSizer(itemBoxSizer5); |
| 977 |
< |
|
| 978 |
< |
wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL); |
| 979 |
< |
itemBoxSizer5->Add(itemBoxSizer6, 0, wxGROW|wxALL, 0); |
| 980 |
< |
SelectAll = new wxCheckBox( itemPanel4, SelectAll_Checkbox, _("Select All/None"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE ); |
| 981 |
< |
SelectAll->SetValue(false); |
| 982 |
< |
SelectAll->SetName(_T("SelectAll_Checkbox")); |
| 983 |
< |
itemBoxSizer6->Add(SelectAll, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); |
| 984 |
< |
|
| 985 |
< |
RefreshButton = new wxBitmapButton( itemPanel4, Refresh_Button, itemFrame1->GetBitmapResource(wxT("redo.xpm")), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); |
| 986 |
< |
RefreshButton->SetName(_T("RefreshButton")); |
| 987 |
< |
itemBoxSizer6->Add(RefreshButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); |
| 988 |
< |
|
| 989 |
< |
wxArrayString Mods_CheckboxListStrings; |
| 990 |
< |
Mods_CheckboxList = new wxCheckListBox( itemPanel4, Mods_CheckboxList1, wxDefaultPosition, wxDefaultSize, Mods_CheckboxListStrings, wxLB_HSCROLL ); |
| 991 |
< |
Mods_CheckboxList->SetName(_T("Mods_CheckboxList")); |
| 992 |
< |
itemBoxSizer5->Add(Mods_CheckboxList, 1, wxGROW|wxALL, 0); |
| 993 |
< |
|
| 994 |
< |
wxPanel* itemPanel10 = new wxPanel( MainSplitter, DescriptionHolder_Panel, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); |
| 995 |
< |
itemPanel10->SetName(_T("DescriptionHolder_Panel")); |
| 996 |
< |
wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL); |
| 997 |
< |
itemPanel10->SetSizer(itemBoxSizer11); |
| 998 |
< |
|
| 999 |
< |
wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL); |
| 1000 |
< |
itemBoxSizer11->Add(itemBoxSizer12, 0, wxGROW|wxALL, 0); |
| 1001 |
< |
wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL); |
| 1002 |
< |
itemBoxSizer12->Add(itemBoxSizer13, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0); |
| 1003 |
< |
titleText = new wxTextCtrl( itemPanel10, Title_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); |
| 1004 |
< |
titleText->SetName(_T("Title_Text")); |
| 1005 |
< |
titleText->SetBackgroundColour(wxColour(240, 240, 240)); |
| 1006 |
< |
itemBoxSizer13->Add(titleText, 1, wxGROW|wxLEFT, 5); |
| 1007 |
< |
|
| 1008 |
< |
wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxVERTICAL); |
| 1009 |
< |
itemBoxSizer12->Add(itemBoxSizer15, 1, wxGROW|wxALL, 0); |
| 1010 |
< |
creatorText = new wxTextCtrl( itemPanel10, Author_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_RIGHT ); |
| 1011 |
< |
creatorText->SetName(_T("Author_Text")); |
| 1012 |
< |
creatorText->SetBackgroundColour(wxColour(240, 240, 240)); |
| 1013 |
< |
itemBoxSizer15->Add(creatorText, 1, wxGROW|wxRIGHT, 5); |
| 1014 |
< |
|
| 1015 |
< |
wxStaticLine* itemStaticLine17 = new wxStaticLine( itemPanel10, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); |
| 1016 |
< |
itemStaticLine17->Show(false); |
| 1017 |
< |
itemBoxSizer11->Add(itemStaticLine17, 0, wxGROW|wxALL, 5); |
| 1018 |
< |
|
| 1019 |
< |
descriptionText = new wxTextCtrl( itemPanel10, Description_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH|wxTE_AUTO_URL ); |
| 1020 |
< |
descriptionText->SetName(_T("DescriptionName")); |
| 1021 |
< |
descriptionText->SetBackgroundColour(wxColour(240, 240, 240)); |
| 1022 |
< |
itemBoxSizer11->Add(descriptionText, 1, wxGROW|wxLEFT|wxRIGHT, 5); |
| 1023 |
< |
|
| 1024 |
< |
MainSplitter->SplitVertically(itemPanel4, itemPanel10, 150); |
| 1025 |
< |
itemBoxSizer2->Add(MainSplitter, 1, wxGROW|wxALL, 0); |
| 1026 |
< |
|
| 1027 |
< |
StatusArea = new wxStatusBar( itemFrame1, ID_STATUSBAR, 0 ); |
| 1028 |
< |
StatusArea->SetName(_T("StatusArea")); |
| 1029 |
< |
StatusArea->SetFieldsCount(1); |
| 1030 |
< |
StatusArea->SetStatusText(_("Status Area"), 0); |
| 1031 |
< |
itemBoxSizer2->Add(StatusArea, 0, wxGROW|wxALL, 0); |
| 1032 |
< |
|
| 1033 |
< |
wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL); |
| 1034 |
< |
itemBoxSizer2->Add(itemBoxSizer20, 0, wxGROW|wxALL, 0); |
| 1035 |
< |
|
| 1036 |
< |
ProgressBar = new wxGauge( itemFrame1, ProgressBar_Gauge, 1000, wxDefaultPosition, wxSize(-1, 30), wxGA_SMOOTH ); |
| 1037 |
< |
ProgressBar->SetValue(0); |
| 1038 |
< |
itemBoxSizer20->Add(ProgressBar, 1, wxGROW|wxALL, 0); |
| 1039 |
< |
|
| 1040 |
< |
InstallButton = new wxButton( itemFrame1, Install_Button, _("Install!"), wxDefaultPosition, wxSize(-1, 30), 0 ); |
| 1041 |
< |
itemBoxSizer20->Add(InstallButton, 0, wxGROW|wxALL, 0); |
| 1042 |
< |
|
| 1043 |
< |
wxBoxSizer* itemBoxSizer23 = new wxBoxSizer(wxVERTICAL); |
| 1044 |
< |
itemBoxSizer2->Add(itemBoxSizer23, 0, wxGROW|wxALL, 0); |
| 1045 |
< |
|
| 1046 |
< |
OptionsPanel = new wxPanel( itemFrame1, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); |
| 1047 |
< |
itemBoxSizer2->Add(OptionsPanel, 0, wxGROW, 0); |
| 1048 |
< |
|
| 1049 |
< |
wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxHORIZONTAL); |
| 1050 |
< |
OptionsPanel->SetSizer(itemBoxSizer25); |
| 1051 |
< |
|
| 1052 |
< |
wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxVERTICAL); |
| 1053 |
< |
itemBoxSizer25->Add(itemBoxSizer26, 0, wxGROW|wxALL, 5); |
| 1054 |
< |
|
| 1055 |
< |
SepRadio = new wxRadioButton( OptionsPanel, Sep_RadioButton, _("Sep"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); |
| 1056 |
< |
SepRadio->SetValue(false); |
| 1057 |
< |
if (MainWindow::ShowToolTips()) |
| 1058 |
< |
SepRadio->SetToolTip(_("For PC Demo and Mac")); |
| 1059 |
< |
itemBoxSizer26->Add(SepRadio, 0, wxALIGN_LEFT|wxALL, 5); |
| 1060 |
< |
|
| 1061 |
< |
NoSepRadio = new wxRadioButton( OptionsPanel, NoSep_RadioButton, _("NoSep"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 1062 |
< |
NoSepRadio->SetValue(false); |
| 1063 |
< |
if (MainWindow::ShowToolTips()) |
| 1064 |
< |
NoSepRadio->SetToolTip(_("For PC Retail")); |
| 1065 |
< |
itemBoxSizer26->Add(NoSepRadio, 0, wxALIGN_LEFT|wxALL, 5); |
| 1066 |
< |
|
| 1067 |
< |
wxStaticLine* itemStaticLine29 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); |
| 1068 |
< |
itemBoxSizer25->Add(itemStaticLine29, 0, wxGROW|wxALL, 5); |
| 1069 |
< |
|
| 1070 |
< |
wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxVERTICAL); |
| 1071 |
< |
itemBoxSizer25->Add(itemBoxSizer30, 0, wxGROW|wxALL, 5); |
| 1072 |
< |
|
| 1073 |
< |
SeparatedRadio = new wxRadioButton( OptionsPanel, Separated_RadioButton, _("Separated Level0"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); |
| 1074 |
< |
SeparatedRadio->SetValue(false); |
| 1075 |
< |
SeparatedRadio->SetName(_T("Separated_RadioButton")); |
| 1076 |
< |
itemBoxSizer30->Add(SeparatedRadio, 0, wxALIGN_LEFT|wxALL, 5); |
| 1077 |
< |
|
| 1078 |
< |
CompleteRadio = new wxRadioButton( OptionsPanel, Complete_RadioButton, _("Complete Level0"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 1079 |
< |
CompleteRadio->SetValue(false); |
| 1080 |
< |
CompleteRadio->SetName(_T("Complete_RadioButton")); |
| 1081 |
< |
itemBoxSizer30->Add(CompleteRadio, 0, wxALIGN_LEFT|wxALL, 5); |
| 1082 |
< |
|
| 1083 |
< |
wxStaticLine* itemStaticLine33 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); |
| 1084 |
< |
itemBoxSizer25->Add(itemStaticLine33, 0, wxGROW|wxALL, 5); |
| 1085 |
< |
|
| 1086 |
< |
wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxVERTICAL); |
| 1087 |
< |
itemBoxSizer25->Add(itemBoxSizer34, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); |
| 1088 |
< |
|
| 1089 |
< |
ReglobalizeButton = new wxButton( OptionsPanel, ReGlobalize_Button, _("Reglobalize"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 1090 |
< |
ReglobalizeButton->SetName(_T("Reglobalize_Button")); |
| 1091 |
< |
itemBoxSizer34->Add(ReglobalizeButton, 0, wxGROW|wxALL, 5); |
| 1131 |
> |
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); |
| 1132 |
> |
itemFrame1->SetSizer(itemBoxSizer2); |
| 1133 |
|
|
| 1134 |
< |
// Connect events and objects |
| 1135 |
< |
Mods_CheckboxList->Connect(Mods_CheckboxList1, wxEVT_CREATE, wxWindowCreateEventHandler(MainWindow::ModList_OnCreate), NULL, this); |
| 1134 |
> |
MainSplitter = new wxSplitterWindow( itemFrame1, ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(100, 100), wxSP_LIVE_UPDATE|wxNO_BORDER ); |
| 1135 |
> |
MainSplitter->SetMinimumPaneSize(1); |
| 1136 |
> |
MainSplitter->SetName(_T("MainSplitter")); |
| 1137 |
> |
|
| 1138 |
> |
wxPanel* itemPanel4 = new wxPanel( MainSplitter, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); |
| 1139 |
> |
wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL); |
| 1140 |
> |
itemPanel4->SetSizer(itemBoxSizer5); |
| 1141 |
> |
|
| 1142 |
> |
wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL); |
| 1143 |
> |
itemBoxSizer5->Add(itemBoxSizer6, 0, wxGROW|wxALL, 0); |
| 1144 |
> |
SelectAll = new wxCheckBox( itemPanel4, SelectAll_Checkbox, _("Select All/None"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE ); |
| 1145 |
> |
SelectAll->SetValue(false); |
| 1146 |
> |
SelectAll->SetName(_T("SelectAll_Checkbox")); |
| 1147 |
> |
itemBoxSizer6->Add(SelectAll, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); |
| 1148 |
> |
|
| 1149 |
> |
RefreshButton = new wxBitmapButton( itemPanel4, Refresh_Button, itemFrame1->GetBitmapResource(wxT("undo.xpm")), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); |
| 1150 |
> |
RefreshButton->SetName(_T("RefreshButton")); |
| 1151 |
> |
itemBoxSizer6->Add(RefreshButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); |
| 1152 |
> |
|
| 1153 |
> |
wxArrayString Mods_CheckboxListStrings; |
| 1154 |
> |
Mods_CheckboxList = new wxCheckListBox( itemPanel4, Mods_CheckboxList1, wxDefaultPosition, wxDefaultSize, Mods_CheckboxListStrings, wxLB_HSCROLL ); |
| 1155 |
> |
Mods_CheckboxList->SetName(_T("Mods_CheckboxList")); |
| 1156 |
> |
itemBoxSizer5->Add(Mods_CheckboxList, 1, wxGROW|wxALL, 0); |
| 1157 |
> |
|
| 1158 |
> |
wxPanel* itemPanel10 = new wxPanel( MainSplitter, DescriptionHolder_Panel, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); |
| 1159 |
> |
itemPanel10->SetName(_T("DescriptionHolder_Panel")); |
| 1160 |
> |
wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL); |
| 1161 |
> |
itemPanel10->SetSizer(itemBoxSizer11); |
| 1162 |
> |
|
| 1163 |
> |
wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL); |
| 1164 |
> |
itemBoxSizer11->Add(itemBoxSizer12, 0, wxGROW|wxALL, 0); |
| 1165 |
> |
wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL); |
| 1166 |
> |
itemBoxSizer12->Add(itemBoxSizer13, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0); |
| 1167 |
> |
titleText = new wxTextCtrl( itemPanel10, Title_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); |
| 1168 |
> |
titleText->SetName(_T("Title_Text")); |
| 1169 |
> |
titleText->SetBackgroundColour(wxColour(240, 240, 240)); |
| 1170 |
> |
itemBoxSizer13->Add(titleText, 1, wxGROW|wxLEFT, 5); |
| 1171 |
> |
|
| 1172 |
> |
wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxVERTICAL); |
| 1173 |
> |
itemBoxSizer12->Add(itemBoxSizer15, 1, wxGROW|wxALL, 0); |
| 1174 |
> |
creatorText = new wxTextCtrl( itemPanel10, Author_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_RIGHT ); |
| 1175 |
> |
creatorText->SetName(_T("Author_Text")); |
| 1176 |
> |
creatorText->SetBackgroundColour(wxColour(240, 240, 240)); |
| 1177 |
> |
itemBoxSizer15->Add(creatorText, 1, wxGROW|wxRIGHT, 5); |
| 1178 |
> |
|
| 1179 |
> |
wxStaticLine* itemStaticLine17 = new wxStaticLine( itemPanel10, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); |
| 1180 |
> |
itemStaticLine17->Show(false); |
| 1181 |
> |
itemBoxSizer11->Add(itemStaticLine17, 0, wxGROW|wxALL, 5); |
| 1182 |
> |
|
| 1183 |
> |
descriptionText = new wxTextCtrl( itemPanel10, Description_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH|wxTE_RICH2 ); |
| 1184 |
> |
descriptionText->SetName(_T("DescriptionName")); |
| 1185 |
> |
descriptionText->SetBackgroundColour(wxColour(240, 240, 240)); |
| 1186 |
> |
itemBoxSizer11->Add(descriptionText, 1, wxGROW|wxLEFT|wxRIGHT, 5); |
| 1187 |
> |
|
| 1188 |
> |
MainSplitter->SplitVertically(itemPanel4, itemPanel10, 200); |
| 1189 |
> |
itemBoxSizer2->Add(MainSplitter, 1, wxGROW|wxALL, 0); |
| 1190 |
> |
|
| 1191 |
> |
StatusArea = new wxStatusBar( itemFrame1, ID_STATUSBAR, 0 ); |
| 1192 |
> |
StatusArea->SetName(_T("StatusArea")); |
| 1193 |
> |
StatusArea->SetFieldsCount(1); |
| 1194 |
> |
StatusArea->SetStatusText(_("AE Installer v1.0.1"), 0); |
| 1195 |
> |
itemBoxSizer2->Add(StatusArea, 0, wxGROW|wxALL, 0); |
| 1196 |
> |
|
| 1197 |
> |
wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL); |
| 1198 |
> |
itemBoxSizer2->Add(itemBoxSizer20, 0, wxGROW|wxALL, 0); |
| 1199 |
> |
|
| 1200 |
> |
ProgressBar = new wxGauge( itemFrame1, ProgressBar_Gauge, 1000, wxDefaultPosition, wxDefaultSize, wxGA_SMOOTH ); |
| 1201 |
> |
ProgressBar->SetValue(0); |
| 1202 |
> |
itemBoxSizer20->Add(ProgressBar, 1, wxGROW|wxALL, 0); |
| 1203 |
> |
|
| 1204 |
> |
InstallButton = new wxButton( itemFrame1, Install_Button, _("Install!"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 1205 |
> |
itemBoxSizer20->Add(InstallButton, 0, wxGROW|wxALL, 0); |
| 1206 |
> |
|
| 1207 |
> |
wxBoxSizer* itemBoxSizer23 = new wxBoxSizer(wxVERTICAL); |
| 1208 |
> |
itemBoxSizer2->Add(itemBoxSizer23, 0, wxGROW|wxALL, 0); |
| 1209 |
> |
|
| 1210 |
> |
OptionsPanel = new wxPanel( itemFrame1, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); |
| 1211 |
> |
itemBoxSizer2->Add(OptionsPanel, 0, wxGROW, 0); |
| 1212 |
> |
|
| 1213 |
> |
wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxHORIZONTAL); |
| 1214 |
> |
OptionsPanel->SetSizer(itemBoxSizer25); |
| 1215 |
> |
|
| 1216 |
> |
wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxVERTICAL); |
| 1217 |
> |
itemBoxSizer25->Add(itemBoxSizer26, 0, wxGROW|wxALL, 5); |
| 1218 |
> |
|
| 1219 |
> |
SepRadio = new wxRadioButton( OptionsPanel, Sep_RadioButton, _("Sep"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); |
| 1220 |
> |
SepRadio->SetValue(false); |
| 1221 |
> |
if (MainWindow::ShowToolTips()) |
| 1222 |
> |
SepRadio->SetToolTip(_("For PC Demo and Mac")); |
| 1223 |
> |
itemBoxSizer26->Add(SepRadio, 0, wxALIGN_LEFT|wxALL, 5); |
| 1224 |
> |
|
| 1225 |
> |
NoSepRadio = new wxRadioButton( OptionsPanel, NoSep_RadioButton, _("NoSep"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 1226 |
> |
NoSepRadio->SetValue(false); |
| 1227 |
> |
if (MainWindow::ShowToolTips()) |
| 1228 |
> |
NoSepRadio->SetToolTip(_("For PC Retail")); |
| 1229 |
> |
itemBoxSizer26->Add(NoSepRadio, 0, wxALIGN_LEFT|wxALL, 5); |
| 1230 |
> |
|
| 1231 |
> |
wxStaticLine* itemStaticLine29 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); |
| 1232 |
> |
itemBoxSizer25->Add(itemStaticLine29, 0, wxGROW|wxALL, 5); |
| 1233 |
> |
|
| 1234 |
> |
wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxVERTICAL); |
| 1235 |
> |
itemBoxSizer25->Add(itemBoxSizer30, 0, wxGROW|wxALL, 5); |
| 1236 |
> |
|
| 1237 |
> |
SeperatedRadio = new wxRadioButton( OptionsPanel, Seperated_RadioButton, _("Separated Level0"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); |
| 1238 |
> |
SeperatedRadio->SetValue(false); |
| 1239 |
> |
SeperatedRadio->SetName(_T("Seperated_RadioButton")); |
| 1240 |
> |
itemBoxSizer30->Add(SeperatedRadio, 0, wxALIGN_LEFT|wxALL, 5); |
| 1241 |
> |
|
| 1242 |
> |
CompleteRadio = new wxRadioButton( OptionsPanel, Complete_RadioButton, _("Complete Level0"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 1243 |
> |
CompleteRadio->SetValue(false); |
| 1244 |
> |
CompleteRadio->SetName(_T("Complete_RadioButton")); |
| 1245 |
> |
itemBoxSizer30->Add(CompleteRadio, 0, wxALIGN_LEFT|wxALL, 5); |
| 1246 |
> |
|
| 1247 |
> |
wxStaticLine* itemStaticLine33 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); |
| 1248 |
> |
itemBoxSizer25->Add(itemStaticLine33, 0, wxGROW|wxALL, 5); |
| 1249 |
> |
|
| 1250 |
> |
wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxVERTICAL); |
| 1251 |
> |
itemBoxSizer25->Add(itemBoxSizer34, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); |
| 1252 |
> |
|
| 1253 |
> |
ReglobalizeButton = new wxButton( OptionsPanel, ReGlobalize_Button, _("Reglobalize"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 1254 |
> |
ReglobalizeButton->SetName(_T("Reglobalize_Button")); |
| 1255 |
> |
itemBoxSizer34->Add(ReglobalizeButton, 0, wxGROW|wxALL, 5); |
| 1256 |
> |
|
| 1257 |
> |
// Connect events and objects |
| 1258 |
> |
Mods_CheckboxList->Connect(Mods_CheckboxList1, wxEVT_CREATE, wxWindowCreateEventHandler(MainWindow::ModList_OnCreate), NULL, this); |
| 1259 |
|
////@end MainWindow content construction |
| 1260 |
+ |
#ifdef WIN32 |
| 1261 |
+ |
Handle = (HWND)GetHWND(); |
| 1262 |
+ |
::CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_ITaskbarList, (void **)&pTaskbarList); |
| 1263 |
+ |
#endif |
| 1264 |
|
|
| 1265 |
< |
if ( exists( "../../GameDataFolder/level0_Final.sep" ) ) { |
| 1266 |
< |
static_cast<string>("-import:sep"); |
| 1265 |
> |
|
| 1266 |
> |
/*if ( exists( "../../GameDataFolder/level0_Final.sep" ) ) { |
| 1267 |
> |
strImportOption = "-import:sep"; |
| 1268 |
|
splitInstances = NOT_SPLIT; |
| 1269 |
|
} |
| 1270 |
|
else { |
| 1271 |
< |
static_cast<string>("-import:nosep"); |
| 1271 |
> |
strImportOption = "-import:nosep"; |
| 1272 |
|
splitInstances = SPLIT; |
| 1273 |
< |
} |
| 1273 |
> |
}*/ |
| 1274 |
> |
|
| 1275 |
|
|
| 1276 |
+ |
#ifndef WIN32 |
| 1277 |
+ |
strImportOption = "-import:sep"; |
| 1278 |
+ |
splitInstances = NOT_SPLIT; |
| 1279 |
+ |
#else |
| 1280 |
+ |
strImportOption = "-import:nosep"; |
| 1281 |
+ |
splitInstances = SPLIT; |
| 1282 |
+ |
#endif |
| 1283 |
+ |
|
| 1284 |
+ |
#ifndef WIN32 |
| 1285 |
+ |
strImportOption = "-import:sep"; |
| 1286 |
+ |
splitInstances = NOT_SPLIT; |
| 1287 |
+ |
#else |
| 1288 |
+ |
strImportOption = "-import:nosep"; |
| 1289 |
+ |
splitInstances = SPLIT; |
| 1290 |
+ |
#endif |
| 1291 |
+ |
|
| 1292 |
|
globalPackages = getPackages(); |
| 1293 |
|
globalInstalledMods = getInstallString(); |
| 1294 |
< |
for (int i = 0; i < globalPackages.size(); i++) { |
| 1294 |
> |
for (unsigned int i = 0; i < globalPackages.size(); i++) { |
| 1295 |
|
Mods_CheckboxList->Append(globalPackages[i].name.c_str()); |
| 1296 |
|
if( binary_search(globalInstalledMods.begin(), globalInstalledMods.end(), globalPackages[i].modStringName ) ) Mods_CheckboxList->Check(i); |
| 1297 |
|
} |
| 1300 |
|
TheInstallButton = InstallButton; |
| 1301 |
|
TheProgressBar = ProgressBar; |
| 1302 |
|
OptionsPanel->Hide(); |
| 1303 |
< |
if(splitInstances == SPLIT) SeparatedRadio->SetValue(true); |
| 1303 |
> |
|
| 1304 |
> |
//#ifndef WIN32 |
| 1305 |
> |
// itemMenu37->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL); |
| 1306 |
> |
|
| 1307 |
> |
//#endif |
| 1308 |
> |
|
| 1309 |
> |
if(splitInstances == SPLIT) SeperatedRadio->SetValue(true); |
| 1310 |
|
else CompleteRadio->SetValue(true); |
| 1119 |
– |
|
| 1120 |
– |
|
| 1121 |
– |
|
| 1311 |
|
if(strImportOption == "-import:nosep") NoSepRadio->SetValue(true); |
| 1312 |
|
else SepRadio->SetValue(true); |
| 1313 |
|
|
| 1330 |
|
{ |
| 1331 |
|
switch(SelectAll->Get3StateValue()) { |
| 1332 |
|
case wxCHK_UNCHECKED: |
| 1333 |
< |
for(int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, false); |
| 1333 |
> |
for(unsigned int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, false); |
| 1334 |
|
//SelectAll->Set3StateValue(wxCHK_CHECKED); |
| 1335 |
|
break; |
| 1336 |
|
case wxCHK_CHECKED: |
| 1337 |
< |
for(int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, true); |
| 1337 |
> |
for(unsigned int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, true); |
| 1338 |
|
//SelectAll->Set3StateValue(wxCHK_UNCHECKED); |
| 1339 |
|
break; |
| 1340 |
|
case wxCHK_UNDETERMINED: |
| 1341 |
< |
for(int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, false); |
| 1341 |
> |
for(unsigned int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, false); |
| 1342 |
|
//SelectAll->Set3StateValue(wxCHK_CHECKED); |
| 1343 |
|
break; |
| 1344 |
|
|
| 1375 |
|
{ |
| 1376 |
|
// Bitmap retrieval |
| 1377 |
|
////@begin MainWindow bitmap retrieval |
| 1378 |
< |
wxUnusedVar(name); |
| 1379 |
< |
if (name == _T("redo.xpm")) |
| 1380 |
< |
{ |
| 1381 |
< |
wxBitmap bitmap(redo_xpm); |
| 1382 |
< |
return bitmap; |
| 1383 |
< |
} |
| 1384 |
< |
else if (name == _T("fileopen.xpm")) |
| 1385 |
< |
{ |
| 1386 |
< |
wxBitmap bitmap( fileopen_xpm); |
| 1387 |
< |
return bitmap; |
| 1388 |
< |
} |
| 1389 |
< |
else if (name == _T("filesaveas.xpm")) |
| 1390 |
< |
{ |
| 1391 |
< |
wxBitmap bitmap( filesaveas_xpm); |
| 1392 |
< |
return bitmap; |
| 1393 |
< |
} |
| 1394 |
< |
else if (name == _T("quit.xpm")) |
| 1395 |
< |
{ |
| 1396 |
< |
wxBitmap bitmap( quit_xpm); |
| 1397 |
< |
return bitmap; |
| 1398 |
< |
} |
| 1399 |
< |
return wxNullBitmap; |
| 1378 |
> |
wxUnusedVar(name); |
| 1379 |
> |
if (name == _T("undo.xpm")) |
| 1380 |
> |
{ |
| 1381 |
> |
wxBitmap bitmap( undo_xpm); |
| 1382 |
> |
return bitmap; |
| 1383 |
> |
} |
| 1384 |
> |
else if (name == _T("fileopen.xpm")) |
| 1385 |
> |
{ |
| 1386 |
> |
wxBitmap bitmap( fileopen_xpm); |
| 1387 |
> |
return bitmap; |
| 1388 |
> |
} |
| 1389 |
> |
else if (name == _T("filesaveas.xpm")) |
| 1390 |
> |
{ |
| 1391 |
> |
wxBitmap bitmap( filesaveas_xpm); |
| 1392 |
> |
return bitmap; |
| 1393 |
> |
} |
| 1394 |
> |
else if (name == _T("quit.xpm")) |
| 1395 |
> |
{ |
| 1396 |
> |
wxBitmap bitmap( quit_xpm); |
| 1397 |
> |
return bitmap; |
| 1398 |
> |
} |
| 1399 |
> |
return wxNullBitmap; |
| 1400 |
|
////@end MainWindow bitmap retrieval |
| 1401 |
|
} |
| 1402 |
|
|
| 1409 |
|
|
| 1410 |
|
// Icon retrieval |
| 1411 |
|
////@begin MainWindow icon retrieval |
| 1412 |
< |
wxUnusedVar(name); |
| 1413 |
< |
if (name == _T("oni_special.ico")) |
| 1414 |
< |
{ |
| 1415 |
< |
// wxIcon icon(_T("oni_special.ico"), wxBITMAP_TYPE_ICO); |
| 1416 |
< |
// return icon; |
| 1417 |
< |
} |
| 1418 |
< |
return wxNullIcon; |
| 1412 |
> |
wxUnusedVar(name); |
| 1413 |
> |
if (name == _T("aelogosmall.png")) |
| 1414 |
> |
{ |
| 1415 |
> |
wxIcon icon(aelogosmall_xpm); |
| 1416 |
> |
return icon; |
| 1417 |
> |
} |
| 1418 |
> |
return wxNullIcon; |
| 1419 |
|
////@end MainWindow icon retrieval |
| 1420 |
|
} |
| 1421 |
|
|
| 1463 |
|
|
| 1464 |
|
void MainWindow::OnOptionsClick( wxCommandEvent& event ) |
| 1465 |
|
{ |
| 1277 |
– |
|
| 1278 |
– |
|
| 1279 |
– |
|
| 1280 |
– |
|
| 1466 |
|
if (!event.GetInt() ) { |
| 1467 |
|
OptionsPanel->Hide(); |
| 1468 |
+ |
|
| 1469 |
|
this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight());} |
| 1470 |
|
else { |
| 1471 |
|
// Uncomment this when we release, it gets annoying if you are testing globalization a lot ;) |
| 1472 |
< |
wxMessageDialog* YesNoDialog = new wxMessageDialog(this, "WARNING: These options are for advanced users only, use with caution.", "AE Installer Alert", wxOK | wxICON_EXCLAMATION , wxDefaultPosition); |
| 1472 |
> |
wxMessageDialog* YesNoDialog = new wxMessageDialog(this, "WARNING: These options are for advanced users only, use with caution.", |
| 1473 |
> |
"AE Installer Alert", wxOK | wxICON_EXCLAMATION , wxDefaultPosition); |
| 1474 |
|
YesNoDialog->ShowModal(); |
| 1475 |
|
OptionsPanel->Show(); |
| 1476 |
< |
this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()+OptionsPanel->GetRect().GetHeight()); |
| 1476 |
> |
this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()+OptionsPanel->GetRect().GetHeight()+1); |
| 1477 |
> |
this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()-1); |
| 1478 |
|
} |
| 1291 |
– |
|
| 1479 |
|
} |
| 1480 |
|
|
| 1481 |
|
|
| 1502 |
|
TheInstallButton->Disable(); |
| 1503 |
|
recompileAll(thePackages); |
| 1504 |
|
TheInstallButton->Enable(); |
| 1505 |
+ |
|
| 1506 |
|
} |
| 1507 |
|
|
| 1508 |
|
vector<string> thePackages; |
| 1509 |
|
}; |
| 1510 |
|
|
| 1511 |
+ |
void globalize2(void) { |
| 1512 |
+ |
TheInstallButton->Disable(); |
| 1513 |
+ |
globalizeData(); |
| 1514 |
+ |
TheInstallButton->Enable(); |
| 1515 |
+ |
} |
| 1516 |
+ |
|
| 1517 |
+ |
|
| 1518 |
+ |
|
| 1519 |
|
void MainWindow::OnInstallButtonClick( wxCommandEvent& event ) |
| 1520 |
|
{ |
| 1521 |
|
|
| 1522 |
|
vector<string> localPackages; |
| 1523 |
< |
localPackages.push_back("Globalize"); |
| 1524 |
< |
for(int i = 0; i < globalPackages.size(); i++) if(Mods_CheckboxList->IsChecked(i)) localPackages.push_back( globalPackages[i].modStringName ); |
| 1523 |
> |
localPackages.push_back("00000Globalize"); |
| 1524 |
> |
for(unsigned int i = 0; i < globalPackages.size(); i++) if(Mods_CheckboxList->IsChecked(i)) localPackages.push_back( globalPackages[i].modStringName ); |
| 1525 |
|
if ( !localPackages.empty() ) { |
| 1526 |
< |
|
| 1526 |
> |
sort(localPackages.begin(), localPackages.end()); |
| 1527 |
> |
localPackages[0] = "Globalize"; |
| 1528 |
|
//MainWindow::MainWindow().Hide(); |
| 1529 |
|
// boost::thread thrd2(recompileAll(localPackages) ); |
| 1530 |
|
//MainWindow::MainWindow().Show(); |
| 1558 |
|
|
| 1559 |
|
void setProgressBar( int i ) { |
| 1560 |
|
//TheProgressBar->SetValue( |
| 1561 |
+ |
#ifdef WIN32 |
| 1562 |
+ |
|
| 1563 |
+ |
|
| 1564 |
+ |
|
| 1565 |
+ |
if (SUCCEEDED(pTaskbarList->QueryInterface(IID_ITaskbarList3, (void **)&pTaskbarList3))) |
| 1566 |
+ |
{ |
| 1567 |
+ |
|
| 1568 |
+ |
pTaskbarList3->SetProgressValue(Handle,i, 1000); |
| 1569 |
+ |
if ( i == 0 ) { |
| 1570 |
|
|
| 1571 |
+ |
pTaskbarList3->SetProgressState(Handle,TBPF_NOPROGRESS); |
| 1572 |
+ |
} |
| 1573 |
+ |
} |
| 1574 |
+ |
|
| 1575 |
+ |
|
| 1576 |
+ |
#endif |
| 1577 |
|
TheProgressBar->SetValue(i); |
| 1578 |
|
|
| 1579 |
|
} |
| 1586 |
|
void MainWindow::OnStatusbarUpdate( wxUpdateUIEvent& event ) |
| 1587 |
|
{ |
| 1588 |
|
////@begin wxEVT_UPDATE_UI event handler for ID_STATUSBAR in MainWindow. |
| 1589 |
< |
// Before editing this code, remove the block markers. |
| 1590 |
< |
event.Skip(); |
| 1589 |
> |
// Before editing this code, remove the block markers. |
| 1590 |
> |
event.Skip(); |
| 1591 |
|
////@end wxEVT_UPDATE_UI event handler for ID_STATUSBAR in MainWindow. |
| 1592 |
|
} |
| 1593 |
|
|
| 1599 |
|
void MainWindow::OnAboutClick( wxCommandEvent& event ) |
| 1600 |
|
{ |
| 1601 |
|
////@begin wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow. |
| 1602 |
< |
// Before editing this code, remove the block markers. |
| 1603 |
< |
About* window = new About(this); |
| 1604 |
< |
int returnValue = window->ShowModal(); |
| 1605 |
< |
window->Destroy(); |
| 1602 |
> |
// Before editing this code, remove the block markers. |
| 1603 |
> |
About* window = new About(this); |
| 1604 |
> |
int returnValue = window->ShowModal(); |
| 1605 |
> |
window->Destroy(); |
| 1606 |
|
////@end wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow. |
| 1607 |
|
} |
| 1608 |
|
|
| 1631 |
|
* wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton |
| 1632 |
|
*/ |
| 1633 |
|
|
| 1422 |
– |
void MainWindow::OnSeparatedRadioButtonSelected( wxCommandEvent& event ) |
| 1423 |
– |
{ |
| 1424 |
– |
splitInstances = SPLIT; |
| 1425 |
– |
|
| 1426 |
– |
} |
| 1427 |
– |
|
| 1428 |
– |
|
| 1634 |
|
/* |
| 1635 |
|
* wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Complete_RadioButton |
| 1636 |
|
*/ |
| 1663 |
|
|
| 1664 |
|
Mods_CheckboxList->Clear(); |
| 1665 |
|
//globalInstalledMods = getPackages(); |
| 1666 |
< |
for (int i = 0; i < globalPackages.size(); i++) { |
| 1666 |
> |
for (unsigned int i = 0; i < globalPackages.size(); i++) { |
| 1667 |
|
Mods_CheckboxList->Append(globalPackages[i].name.c_str()); |
| 1668 |
|
if( binary_search(s.begin(), s.end(), globalPackages[i].modStringName ) ) Mods_CheckboxList->Check(i); |
| 1669 |
|
//else Mods_CheckboxList->Check(i,0); |
| 1726 |
|
ofstream file(openFileDialog->GetPath().c_str()); |
| 1727 |
|
|
| 1728 |
|
vector<string>list; |
| 1729 |
< |
for(int i = 0; i < globalPackages.size(); i++) if(Mods_CheckboxList->IsChecked(i)) list.push_back( globalPackages[i].modStringName ); |
| 1729 |
> |
for(unsigned int i = 0; i < globalPackages.size(); i++) if(Mods_CheckboxList->IsChecked(i)) list.push_back( globalPackages[i].modStringName ); |
| 1730 |
|
vector<string>::iterator begin_iter = list.begin(); |
| 1731 |
|
vector<string>::iterator end_iter = list.end(); |
| 1732 |
|
|
| 1754 |
|
|
| 1755 |
|
void MainWindow::OnReGlobalizeButtonClick( wxCommandEvent& event ) |
| 1756 |
|
{ |
| 1757 |
< |
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); |
| 1757 |
> |
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); |
| 1758 |
|
|
| 1759 |
|
if (YesNoDialog->ShowModal() == wxID_NO) { //if the user said no... |
| 1760 |
|
|
| 1792 |
|
////@end wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton in MainWindow. |
| 1793 |
|
}*/ |
| 1794 |
|
|
| 1795 |
+ |
|
| 1796 |
+ |
/* |
| 1797 |
+ |
* wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Seperated_RadioButton |
| 1798 |
+ |
*/ |
| 1799 |
+ |
|
| 1800 |
+ |
void MainWindow::OnSeperatedRadioButtonSelected( wxCommandEvent& event ) |
| 1801 |
+ |
{ |
| 1802 |
+ |
splitInstances = SPLIT; |
| 1803 |
+ |
} |
| 1804 |
+ |
|