| 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 |
| 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 |
< |
|
| 152 |
< |
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 |
|
} |
| 300 |
|
else { |
| 301 |
< |
//logfile << "\tMoved file: " << dir_itr->path().filename() << "\n"; |
| 301 |
> |
logfile << "\tMoved file: " << dir_itr->path().filename() << "\n"; |
| 302 |
|
} |
| 303 |
|
} |
| 304 |
|
|
| 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()); |
| 364 |
|
create_directory((path)"../GameDataFolder/IGMD"); |
| 365 |
|
copy((path)"packages/VanillaBSL/IGMD", (path)"../GameDataFolder"); |
| 366 |
|
setProgressBar( 1000 ); |
| 367 |
< |
|
| 368 |
< |
// 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/ |
| 369 |
< |
|
| 370 |
< |
// CIP:then copy persist.dat and keyconfig.txt into edition/ as well |
| 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 |
< |
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, |
| 376 |
< |
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 */ |
| 377 |
< |
path fullAEpath = system_complete("."); // get full path for Installer |
| 378 |
< |
char prefsCommand[300] = "defaults write com.godgames.oni RetailInstallationPath -string '"; |
| 379 |
< |
strcat(prefsCommand, fullAEpath.parent_path().parent_path().string().c_str()); // get path of edition/ folder (Oni wants the folder that *contains* the GDF) |
| 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; |
| 374 |
< |
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 |
|
} |
| 483 |
– |
} |
| 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 |
|
} |
| 503 |
– |
|
| 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 |
< |
|
| 517 |
< |
setStatusArea("Importing levels..."); |
| 518 |
< |
//setStatusArea("Recompiling Data..."); |
| 519 |
< |
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(); |
| 556 |
– |
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"; |
| 640 |
< |
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 |
+ |
|
| 726 |
+ |
|
| 727 |
+ |
vector<string> BSLfolders; |
| 728 |
+ |
vector<string> skippedfolders; |
| 729 |
+ |
|
| 730 |
+ |
|
| 731 |
+ |
ofstream BSLlog("BSL.log"); |
| 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 |
+ |
BSLlog << "Copied " << globalPackages[j].modStringName << "!\n"; |
| 751 |
+ |
} |
| 752 |
+ |
|
| 753 |
+ |
} |
| 754 |
+ |
|
| 755 |
+ |
} |
| 756 |
+ |
} |
| 757 |
+ |
|
| 758 |
+ |
ModPackage emptyPackage; |
| 759 |
+ |
emptyPackage.modStringName = "VanillaBSL"; |
| 760 |
+ |
emptyPackage.hasBSL = 1; |
| 761 |
+ |
copyBSL("packages/VanillaBSL/IGMD", BSLfolders, emptyPackage); |
| 762 |
+ |
BSLlog.close(); |
| 763 |
+ |
|
| 764 |
+ |
|
| 765 |
|
logfile << "Writing config file"; |
| 766 |
|
writeInstalledMods(installedMods); |
| 767 |
|
setProgressBar(1000); |
| 768 |
< |
setStatusArea("Done! You can now play Oni."); |
| 768 |
> |
|
| 769 |
> |
string finallyDone = "Done! You can now play Oni."; |
| 770 |
> |
|
| 771 |
> |
|
| 772 |
> |
|
| 773 |
> |
setStatusArea(finallyDone); |
| 774 |
|
|
| 775 |
|
ptime end_time(second_clock::local_time()); |
| 776 |
|
time_period total_time (start_time, end_time); |
| 779 |
|
ofstream logfile2("Install.log", ios::app | ios::ate); |
| 780 |
|
string outstring = (string)"\n\nGlobalization ended " + to_simple_string(end_time) + "\nThe process took ";// + (string)total_time.length(); |
| 781 |
|
|
| 782 |
< |
logfile2 << "\nGlobalization ended " << to_simple_string(end_time) << "\nThe process took " << total_time.length(); |
| 782 |
> |
logfile2 << "\nInstallation ended " << to_simple_string(end_time) << "\nThe process took " << total_time.length(); |
| 783 |
|
|
| 784 |
|
//logfile2.write(outstring.c_str(), outstring.length()); |
| 785 |
|
logfile2.close(); |
| 788 |
|
|
| 789 |
|
Sleep(1000); |
| 790 |
|
setProgressBar(0); |
| 791 |
+ |
|
| 792 |
+ |
} |
| 793 |
+ |
catch(exception & ex) { |
| 794 |
+ |
remove("Install.log"); //why did we do this? :| |
| 795 |
+ |
ofstream logfile("Install.log"); |
| 796 |
+ |
|
| 797 |
+ |
|
| 798 |
+ |
logfile << "Warning, exception " << ex.what() << "!"; |
| 799 |
+ |
setStatusArea("Warning, exception " + (string)ex.what() + "!"); |
| 800 |
+ |
logfile.close(); |
| 801 |
+ |
} |
| 802 |
|
busy = 0; |
| 803 |
|
} |
| 804 |
|
|
| 805 |
+ |
void copyBSL(string copypath, vector<string>& BSLfolders, ModPackage pkg) { |
| 806 |
+ |
|
| 807 |
+ |
ofstream BSLlog("BSL2.log", ios::app ); |
| 808 |
+ |
|
| 809 |
+ |
try { |
| 810 |
+ |
for ( directory_iterator dir_itr( copypath ), end_itr; |
| 811 |
+ |
dir_itr != end_itr; |
| 812 |
+ |
++dir_itr ) { |
| 813 |
+ |
|
| 814 |
+ |
if ( is_directory( dir_itr->path() ) && dir_itr->path().string() != ".svn" ) { |
| 815 |
+ |
BSLlog << "Testing " << dir_itr->path().string() << " HasBSL: " << pkg.hasBSL << " HasAddon: " << pkg.hasAddon << "\n"; |
| 816 |
+ |
int skip_folder = 0; |
| 817 |
+ |
|
| 818 |
+ |
for(unsigned int k = 0; k < BSLfolders.size(); k++) {//iterate through already found BSL folders |
| 819 |
+ |
BSLlog << "testing " << dir_itr->path().filename() << " vs " << BSLfolders[k] << "\n"; |
| 820 |
+ |
if(dir_itr->path().filename() == BSLfolders[k]) { |
| 821 |
+ |
skip_folder = 1; |
| 822 |
+ |
BSLlog << "skipping " << BSLfolders[k] << " in " << pkg.modStringName << "\n"; |
| 823 |
+ |
break; |
| 824 |
+ |
} |
| 825 |
+ |
} |
| 826 |
+ |
if (!skip_folder && !exists("../GameDataFolder/IGMD/" + dir_itr->path().filename() + "/ignore.txt")) { |
| 827 |
+ |
remove_all( "../GameDataFolder/IGMD/" + dir_itr->path().filename() ); |
| 828 |
+ |
Sleep(100); |
| 829 |
+ |
create_directory( "../GameDataFolder/IGMD/" + dir_itr->path().filename()); |
| 830 |
+ |
BSLlog << "Copied " << dir_itr->path().string() << " in " << pkg.modStringName << "!\n"; |
| 831 |
+ |
for ( directory_iterator bsl_itr( dir_itr->path() ); |
| 832 |
+ |
bsl_itr != end_itr; |
| 833 |
+ |
bsl_itr++ ) { |
| 834 |
+ |
if ( bsl_itr->path().extension() == ".bsl" ) { |
| 835 |
+ |
copy_file(bsl_itr->path(), "../GameDataFolder/IGMD/" + dir_itr->path().filename() + "/" + bsl_itr->path().filename()); |
| 836 |
+ |
} |
| 837 |
+ |
} |
| 838 |
+ |
BSLfolders.push_back( dir_itr->path().filename() ); //add back check for addon |
| 839 |
+ |
BSLlog << "Pushing " << dir_itr->path().filename() << "\n" ; |
| 840 |
+ |
} |
| 841 |
+ |
} |
| 842 |
+ |
} |
| 843 |
+ |
} |
| 844 |
+ |
catch ( const std::exception & ex ) |
| 845 |
+ |
{ |
| 846 |
+ |
setStatusArea("Warning, exception " + (string)ex.what() + "!"); |
| 847 |
+ |
while(1) Sleep(1000); |
| 848 |
+ |
} |
| 849 |
+ |
BSLlog.close(); |
| 850 |
+ |
|
| 851 |
+ |
} |
| 852 |
+ |
|
| 853 |
+ |
|
| 854 |
|
void writeInstalledMods(vector<string> installedMods) |
| 855 |
|
{ |
| 856 |
|
|
| 932 |
|
|
| 933 |
|
} |
| 934 |
|
|
| 772 |
– |
vector<string> globalInstalledMods; |
| 773 |
– |
vector<ModPackage> globalPackages; |
| 935 |
|
#include "boost/thread.hpp" |
| 936 |
|
#include <boost/thread/mutex.hpp> |
| 937 |
|
|
| 958 |
|
#endif |
| 959 |
|
|
| 960 |
|
////@begin includes |
| 961 |
< |
#include "about_window.h" |
| 961 |
> |
#include "about.h" |
| 962 |
|
////@end includes |
| 963 |
|
|
| 964 |
|
#include "main_window.h" |
| 965 |
|
|
| 966 |
|
////@begin XPM images |
| 967 |
< |
#include "redo.xpm" |
| 967 |
> |
#include "aelogosmall.xpm" |
| 968 |
> |
#include "undo.xpm" |
| 969 |
|
#include "fileopen.xpm" |
| 970 |
|
#include "filesaveas.xpm" |
| 971 |
|
#include "quit.xpm" |
| 988 |
|
BEGIN_EVENT_TABLE( MainWindow, wxFrame ) |
| 989 |
|
|
| 990 |
|
////@begin MainWindow event table entries |
| 991 |
< |
EVT_CHECKBOX( SelectAll_Checkbox, MainWindow::OnSelectAllCheckboxClick ) |
| 991 |
> |
EVT_CHECKBOX( SelectAll_Checkbox, MainWindow::OnSelectAllCheckboxClick ) |
| 992 |
|
|
| 993 |
< |
EVT_BUTTON( Refresh_Button, MainWindow::OnRefreshButtonClick ) |
| 993 |
> |
EVT_BUTTON( Refresh_Button, MainWindow::OnRefreshButtonClick ) |
| 994 |
|
|
| 995 |
< |
EVT_LISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Selected ) |
| 996 |
< |
EVT_CHECKLISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Toggled ) |
| 995 |
> |
EVT_LISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Selected ) |
| 996 |
> |
EVT_CHECKLISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Toggled ) |
| 997 |
|
|
| 998 |
< |
EVT_UPDATE_UI( ID_STATUSBAR, MainWindow::OnStatusbarUpdate ) |
| 998 |
> |
EVT_UPDATE_UI( ID_STATUSBAR, MainWindow::OnStatusbarUpdate ) |
| 999 |
|
|
| 1000 |
< |
EVT_BUTTON( Install_Button, MainWindow::OnInstallButtonClick ) |
| 1000 |
> |
EVT_BUTTON( Install_Button, MainWindow::OnInstallButtonClick ) |
| 1001 |
|
|
| 1002 |
< |
EVT_RADIOBUTTON( Sep_RadioButton, MainWindow::OnSepRadioButtonSelected ) |
| 1002 |
> |
EVT_RADIOBUTTON( Sep_RadioButton, MainWindow::OnSepRadioButtonSelected ) |
| 1003 |
|
|
| 1004 |
< |
EVT_RADIOBUTTON( NoSep_RadioButton, MainWindow::OnNoSepRadioButtonSelected ) |
| 1004 |
> |
EVT_RADIOBUTTON( NoSep_RadioButton, MainWindow::OnNoSepRadioButtonSelected ) |
| 1005 |
|
|
| 1006 |
< |
EVT_RADIOBUTTON( Separated_RadioButton, MainWindow::OnSeparatedRadioButtonSelected ) |
| 1006 |
> |
EVT_RADIOBUTTON( Seperated_RadioButton, MainWindow::OnSeperatedRadioButtonSelected ) |
| 1007 |
|
|
| 1008 |
< |
EVT_RADIOBUTTON( Complete_RadioButton, MainWindow::OnCompleteRadioButtonSelected ) |
| 1008 |
> |
EVT_RADIOBUTTON( Complete_RadioButton, MainWindow::OnCompleteRadioButtonSelected ) |
| 1009 |
|
|
| 1010 |
< |
EVT_BUTTON( ReGlobalize_Button, MainWindow::OnReGlobalizeButtonClick ) |
| 1010 |
> |
EVT_BUTTON( ReGlobalize_Button, MainWindow::OnReGlobalizeButtonClick ) |
| 1011 |
|
|
| 1012 |
< |
EVT_MENU( wxID_LOAD, MainWindow::OnLoadClick ) |
| 1012 |
> |
EVT_MENU( wxID_LOAD, MainWindow::OnLoadClick ) |
| 1013 |
|
|
| 1014 |
< |
EVT_MENU( wxID_SAVE, MainWindow::OnSaveClick ) |
| 1014 |
> |
EVT_MENU( wxID_SAVE, MainWindow::OnSaveClick ) |
| 1015 |
|
|
| 1016 |
< |
EVT_MENU( wxID_EXIT, MainWindow::OnExitClick ) |
| 1016 |
> |
EVT_MENU( wxID_EXIT, MainWindow::OnExitClick ) |
| 1017 |
|
|
| 1018 |
< |
EVT_MENU( wxID_OPTIONS, MainWindow::OnOptionsClick ) |
| 1018 |
> |
EVT_MENU( wxID_OPTIONS, MainWindow::OnOptionsClick ) |
| 1019 |
|
|
| 1020 |
< |
EVT_MENU( wxID_ABOUT, MainWindow::OnAboutClick ) |
| 1020 |
> |
EVT_MENU( wxID_ABOUT, MainWindow::OnAboutClick ) |
| 1021 |
|
|
| 1022 |
|
////@end MainWindow event table entries |
| 1023 |
|
|
| 1047 |
|
bool MainWindow::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) |
| 1048 |
|
{ |
| 1049 |
|
////@begin MainWindow creation |
| 1050 |
< |
wxFrame::Create( parent, id, caption, pos, size, style ); |
| 889 |
< |
|
| 890 |
< |
CreateControls(); |
| 891 |
< |
SetIcon(GetIconResource(wxT("oni_special.ico"))); |
| 892 |
< |
Centre(); |
| 893 |
< |
|
| 1050 |
> |
wxFrame::Create( parent, id, caption, pos, size, style ); |
| 1051 |
|
|
| 1052 |
+ |
CreateControls(); |
| 1053 |
+ |
SetIcon(GetIconResource(wxT("aelogosmall.png"))); |
| 1054 |
+ |
Centre(); |
| 1055 |
|
////@end MainWindow creation |
| 1056 |
|
return true; |
| 1057 |
|
} |
| 1075 |
|
void MainWindow::Init() |
| 1076 |
|
{ |
| 1077 |
|
////@begin MainWindow member initialisation |
| 1078 |
< |
MainSplitter = NULL; |
| 1079 |
< |
SelectAll = NULL; |
| 1080 |
< |
RefreshButton = NULL; |
| 1081 |
< |
Mods_CheckboxList = NULL; |
| 1082 |
< |
titleText = NULL; |
| 1083 |
< |
creatorText = NULL; |
| 1084 |
< |
descriptionText = NULL; |
| 1085 |
< |
StatusArea = NULL; |
| 1086 |
< |
ProgressBar = NULL; |
| 1087 |
< |
InstallButton = NULL; |
| 1088 |
< |
OptionsPanel = NULL; |
| 1089 |
< |
SepRadio = NULL; |
| 1090 |
< |
NoSepRadio = NULL; |
| 1091 |
< |
SeparatedRadio = NULL; |
| 1092 |
< |
CompleteRadio = NULL; |
| 1093 |
< |
ReglobalizeButton = NULL; |
| 1078 |
> |
MainSplitter = NULL; |
| 1079 |
> |
SelectAll = NULL; |
| 1080 |
> |
RefreshButton = NULL; |
| 1081 |
> |
Mods_CheckboxList = NULL; |
| 1082 |
> |
titleText = NULL; |
| 1083 |
> |
creatorText = NULL; |
| 1084 |
> |
descriptionText = NULL; |
| 1085 |
> |
StatusArea = NULL; |
| 1086 |
> |
ProgressBar = NULL; |
| 1087 |
> |
InstallButton = NULL; |
| 1088 |
> |
OptionsPanel = NULL; |
| 1089 |
> |
SepRadio = NULL; |
| 1090 |
> |
NoSepRadio = NULL; |
| 1091 |
> |
SeperatedRadio = NULL; |
| 1092 |
> |
CompleteRadio = NULL; |
| 1093 |
> |
ReglobalizeButton = NULL; |
| 1094 |
|
////@end MainWindow member initialisation |
| 1095 |
|
|
| 1096 |
|
} |
| 1105 |
|
void MainWindow::CreateControls() |
| 1106 |
|
{ |
| 1107 |
|
////@begin MainWindow content construction |
| 1108 |
< |
// Generated by DialogBlocks, 31/05/2009 19:03:55 (unregistered) |
| 1108 |
> |
MainWindow* itemFrame1 = this; |
| 1109 |
|
|
| 1110 |
< |
MainWindow* itemFrame1 = this; |
| 1111 |
< |
|
| 1112 |
< |
wxMenuBar* menuBar = new wxMenuBar; |
| 1113 |
< |
wxMenu* itemMenu37 = new wxMenu; |
| 1114 |
< |
{ |
| 1115 |
< |
wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_LOAD, _("&Load Configuration..."), wxEmptyString, wxITEM_NORMAL); |
| 1116 |
< |
wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("fileopen.xpm"))); |
| 1117 |
< |
menuItem->SetBitmap(bitmap); |
| 1118 |
< |
itemMenu37->Append(menuItem); |
| 1119 |
< |
} |
| 1120 |
< |
{ |
| 1121 |
< |
wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_SAVE, _("&Save Configuration..."), wxEmptyString, wxITEM_NORMAL); |
| 1122 |
< |
wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("filesaveas.xpm"))); |
| 1123 |
< |
menuItem->SetBitmap(bitmap); |
| 1124 |
< |
itemMenu37->Append(menuItem); |
| 1125 |
< |
} |
| 1126 |
< |
itemMenu37->AppendSeparator(); |
| 1127 |
< |
{ |
| 1128 |
< |
wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_EXIT, _("Exit"), wxEmptyString, wxITEM_NORMAL); |
| 1129 |
< |
wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("quit.xpm"))); |
| 1130 |
< |
menuItem->SetBitmap(bitmap); |
| 1131 |
< |
itemMenu37->Append(menuItem); |
| 1132 |
< |
} |
| 1133 |
< |
menuBar->Append(itemMenu37, _("&File")); |
| 1134 |
< |
wxMenu* itemMenu42 = new wxMenu; |
| 1135 |
< |
itemMenu42->Append(wxID_OPTIONS, _("Show Advanced Options..."), wxEmptyString, wxITEM_CHECK); |
| 1136 |
< |
menuBar->Append(itemMenu42, _("Options")); |
| 977 |
< |
wxMenu* itemMenu44 = new wxMenu; |
| 978 |
< |
itemMenu44->Append(wxID_HELP, _("Help"), wxEmptyString, wxITEM_NORMAL); |
| 1110 |
> |
wxMenuBar* menuBar = new wxMenuBar; |
| 1111 |
> |
wxMenu* itemMenu37 = new wxMenu; |
| 1112 |
> |
{ |
| 1113 |
> |
wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_LOAD, _("&Load Configuration..."), wxEmptyString, wxITEM_NORMAL); |
| 1114 |
> |
wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("fileopen.xpm"))); |
| 1115 |
> |
menuItem->SetBitmap(bitmap); |
| 1116 |
> |
itemMenu37->Append(menuItem); |
| 1117 |
> |
} |
| 1118 |
> |
{ |
| 1119 |
> |
wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_SAVE, _("&Save Configuration..."), wxEmptyString, wxITEM_NORMAL); |
| 1120 |
> |
wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("filesaveas.xpm"))); |
| 1121 |
> |
menuItem->SetBitmap(bitmap); |
| 1122 |
> |
itemMenu37->Append(menuItem); |
| 1123 |
> |
} |
| 1124 |
> |
itemMenu37->AppendSeparator(); |
| 1125 |
> |
{ |
| 1126 |
> |
wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_EXIT, _("Exit"), wxEmptyString, wxITEM_NORMAL); |
| 1127 |
> |
wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("quit.xpm"))); |
| 1128 |
> |
menuItem->SetBitmap(bitmap); |
| 1129 |
> |
itemMenu37->Append(menuItem); |
| 1130 |
> |
} |
| 1131 |
> |
menuBar->Append(itemMenu37, _("&File")); |
| 1132 |
> |
wxMenu* itemMenu42 = new wxMenu; |
| 1133 |
> |
itemMenu42->Append(wxID_OPTIONS, _("Show Advanced Options..."), wxEmptyString, wxITEM_CHECK); |
| 1134 |
> |
menuBar->Append(itemMenu42, _("Options")); |
| 1135 |
> |
wxMenu* itemMenu44 = new wxMenu; |
| 1136 |
> |
#ifdef WIN32 |
| 1137 |
|
itemMenu44->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL); |
| 1138 |
|
menuBar->Append(itemMenu44, _("Help")); |
| 1139 |
< |
itemFrame1->SetMenuBar(menuBar); |
| 1140 |
< |
|
| 1141 |
< |
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); |
| 984 |
< |
itemFrame1->SetSizer(itemBoxSizer2); |
| 1139 |
> |
#else |
| 1140 |
> |
itemMenu37->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL); |
| 1141 |
> |
#endif |
| 1142 |
|
|
| 1143 |
< |
MainSplitter = new wxSplitterWindow( itemFrame1, ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(100, 100), wxSP_LIVE_UPDATE|wxNO_BORDER ); |
| 987 |
< |
MainSplitter->SetMinimumPaneSize(150); |
| 988 |
< |
MainSplitter->SetName(_T("MainSplitter")); |
| 989 |
< |
|
| 990 |
< |
wxPanel* itemPanel4 = new wxPanel( MainSplitter, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); |
| 991 |
< |
wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL); |
| 992 |
< |
itemPanel4->SetSizer(itemBoxSizer5); |
| 993 |
< |
|
| 994 |
< |
wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL); |
| 995 |
< |
itemBoxSizer5->Add(itemBoxSizer6, 0, wxGROW|wxALL, 0); |
| 996 |
< |
SelectAll = new wxCheckBox( itemPanel4, SelectAll_Checkbox, _("Select All/None"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE ); |
| 997 |
< |
SelectAll->SetValue(false); |
| 998 |
< |
SelectAll->SetName(_T("SelectAll_Checkbox")); |
| 999 |
< |
itemBoxSizer6->Add(SelectAll, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); |
| 1000 |
< |
|
| 1001 |
< |
RefreshButton = new wxBitmapButton( itemPanel4, Refresh_Button, itemFrame1->GetBitmapResource(wxT("redo.xpm")), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); |
| 1002 |
< |
RefreshButton->SetName(_T("RefreshButton")); |
| 1003 |
< |
itemBoxSizer6->Add(RefreshButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); |
| 1004 |
< |
|
| 1005 |
< |
wxArrayString Mods_CheckboxListStrings; |
| 1006 |
< |
Mods_CheckboxList = new wxCheckListBox( itemPanel4, Mods_CheckboxList1, wxDefaultPosition, wxDefaultSize, Mods_CheckboxListStrings, wxLB_HSCROLL ); |
| 1007 |
< |
Mods_CheckboxList->SetName(_T("Mods_CheckboxList")); |
| 1008 |
< |
itemBoxSizer5->Add(Mods_CheckboxList, 1, wxGROW|wxALL, 0); |
| 1009 |
< |
|
| 1010 |
< |
wxPanel* itemPanel10 = new wxPanel( MainSplitter, DescriptionHolder_Panel, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); |
| 1011 |
< |
itemPanel10->SetName(_T("DescriptionHolder_Panel")); |
| 1012 |
< |
wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL); |
| 1013 |
< |
itemPanel10->SetSizer(itemBoxSizer11); |
| 1014 |
< |
|
| 1015 |
< |
wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL); |
| 1016 |
< |
itemBoxSizer11->Add(itemBoxSizer12, 0, wxGROW|wxALL, 0); |
| 1017 |
< |
wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL); |
| 1018 |
< |
itemBoxSizer12->Add(itemBoxSizer13, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0); |
| 1019 |
< |
titleText = new wxTextCtrl( itemPanel10, Title_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); |
| 1020 |
< |
titleText->SetName(_T("Title_Text")); |
| 1021 |
< |
titleText->SetBackgroundColour(wxColour(240, 240, 240)); |
| 1022 |
< |
itemBoxSizer13->Add(titleText, 1, wxGROW|wxLEFT, 5); |
| 1023 |
< |
|
| 1024 |
< |
wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxVERTICAL); |
| 1025 |
< |
itemBoxSizer12->Add(itemBoxSizer15, 1, wxGROW|wxALL, 0); |
| 1026 |
< |
creatorText = new wxTextCtrl( itemPanel10, Author_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_RIGHT ); |
| 1027 |
< |
creatorText->SetName(_T("Author_Text")); |
| 1028 |
< |
creatorText->SetBackgroundColour(wxColour(240, 240, 240)); |
| 1029 |
< |
itemBoxSizer15->Add(creatorText, 1, wxGROW|wxRIGHT, 5); |
| 1030 |
< |
|
| 1031 |
< |
wxStaticLine* itemStaticLine17 = new wxStaticLine( itemPanel10, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); |
| 1032 |
< |
itemStaticLine17->Show(false); |
| 1033 |
< |
itemBoxSizer11->Add(itemStaticLine17, 0, wxGROW|wxALL, 5); |
| 1034 |
< |
|
| 1035 |
< |
descriptionText = new wxTextCtrl( itemPanel10, Description_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH|wxTE_AUTO_URL ); |
| 1036 |
< |
descriptionText->SetName(_T("DescriptionName")); |
| 1037 |
< |
descriptionText->SetBackgroundColour(wxColour(240, 240, 240)); |
| 1038 |
< |
itemBoxSizer11->Add(descriptionText, 1, wxGROW|wxLEFT|wxRIGHT, 5); |
| 1039 |
< |
|
| 1040 |
< |
MainSplitter->SplitVertically(itemPanel4, itemPanel10, 150); |
| 1041 |
< |
itemBoxSizer2->Add(MainSplitter, 1, wxGROW|wxALL, 0); |
| 1042 |
< |
|
| 1043 |
< |
StatusArea = new wxStatusBar( itemFrame1, ID_STATUSBAR, 0 ); |
| 1044 |
< |
StatusArea->SetName(_T("StatusArea")); |
| 1045 |
< |
StatusArea->SetFieldsCount(1); |
| 1046 |
< |
StatusArea->SetStatusText(_("Status Area"), 0); |
| 1047 |
< |
itemBoxSizer2->Add(StatusArea, 0, wxGROW|wxALL, 0); |
| 1048 |
< |
|
| 1049 |
< |
wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL); |
| 1050 |
< |
itemBoxSizer2->Add(itemBoxSizer20, 0, wxGROW|wxALL, 0); |
| 1051 |
< |
|
| 1052 |
< |
ProgressBar = new wxGauge( itemFrame1, ProgressBar_Gauge, 1000, wxDefaultPosition, wxSize(-1, 30), wxGA_SMOOTH ); |
| 1053 |
< |
ProgressBar->SetValue(0); |
| 1054 |
< |
itemBoxSizer20->Add(ProgressBar, 1, wxGROW|wxALL, 0); |
| 1055 |
< |
|
| 1056 |
< |
InstallButton = new wxButton( itemFrame1, Install_Button, _("Install!"), wxDefaultPosition, wxSize(-1, 30), 0 ); |
| 1057 |
< |
itemBoxSizer20->Add(InstallButton, 0, wxGROW|wxALL, 0); |
| 1058 |
< |
|
| 1059 |
< |
wxBoxSizer* itemBoxSizer23 = new wxBoxSizer(wxVERTICAL); |
| 1060 |
< |
itemBoxSizer2->Add(itemBoxSizer23, 0, wxGROW|wxALL, 0); |
| 1061 |
< |
|
| 1062 |
< |
OptionsPanel = new wxPanel( itemFrame1, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); |
| 1063 |
< |
itemBoxSizer2->Add(OptionsPanel, 0, wxGROW, 0); |
| 1064 |
< |
|
| 1065 |
< |
wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxHORIZONTAL); |
| 1066 |
< |
OptionsPanel->SetSizer(itemBoxSizer25); |
| 1067 |
< |
|
| 1068 |
< |
wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxVERTICAL); |
| 1069 |
< |
itemBoxSizer25->Add(itemBoxSizer26, 0, wxGROW|wxALL, 5); |
| 1070 |
< |
|
| 1071 |
< |
SepRadio = new wxRadioButton( OptionsPanel, Sep_RadioButton, _("Sep"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); |
| 1072 |
< |
SepRadio->SetValue(false); |
| 1073 |
< |
if (MainWindow::ShowToolTips()) |
| 1074 |
< |
SepRadio->SetToolTip(_("For PC Demo and Mac")); |
| 1075 |
< |
itemBoxSizer26->Add(SepRadio, 0, wxALIGN_LEFT|wxALL, 5); |
| 1076 |
< |
|
| 1077 |
< |
NoSepRadio = new wxRadioButton( OptionsPanel, NoSep_RadioButton, _("NoSep"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 1078 |
< |
NoSepRadio->SetValue(false); |
| 1079 |
< |
if (MainWindow::ShowToolTips()) |
| 1080 |
< |
NoSepRadio->SetToolTip(_("For PC Retail")); |
| 1081 |
< |
itemBoxSizer26->Add(NoSepRadio, 0, wxALIGN_LEFT|wxALL, 5); |
| 1082 |
< |
|
| 1083 |
< |
wxStaticLine* itemStaticLine29 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); |
| 1084 |
< |
itemBoxSizer25->Add(itemStaticLine29, 0, wxGROW|wxALL, 5); |
| 1085 |
< |
|
| 1086 |
< |
wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxVERTICAL); |
| 1087 |
< |
itemBoxSizer25->Add(itemBoxSizer30, 0, wxGROW|wxALL, 5); |
| 1088 |
< |
|
| 1089 |
< |
SeparatedRadio = new wxRadioButton( OptionsPanel, Separated_RadioButton, _("Separated Level0"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); |
| 1090 |
< |
SeparatedRadio->SetValue(false); |
| 1091 |
< |
SeparatedRadio->SetName(_T("Separated_RadioButton")); |
| 1092 |
< |
itemBoxSizer30->Add(SeparatedRadio, 0, wxALIGN_LEFT|wxALL, 5); |
| 1093 |
< |
|
| 1094 |
< |
CompleteRadio = new wxRadioButton( OptionsPanel, Complete_RadioButton, _("Complete Level0"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 1095 |
< |
CompleteRadio->SetValue(false); |
| 1096 |
< |
CompleteRadio->SetName(_T("Complete_RadioButton")); |
| 1097 |
< |
itemBoxSizer30->Add(CompleteRadio, 0, wxALIGN_LEFT|wxALL, 5); |
| 1098 |
< |
|
| 1099 |
< |
wxStaticLine* itemStaticLine33 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); |
| 1100 |
< |
itemBoxSizer25->Add(itemStaticLine33, 0, wxGROW|wxALL, 5); |
| 1101 |
< |
|
| 1102 |
< |
wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxVERTICAL); |
| 1103 |
< |
itemBoxSizer25->Add(itemBoxSizer34, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); |
| 1104 |
< |
|
| 1105 |
< |
ReglobalizeButton = new wxButton( OptionsPanel, ReGlobalize_Button, _("Reglobalize"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 1106 |
< |
ReglobalizeButton->SetName(_T("Reglobalize_Button")); |
| 1107 |
< |
itemBoxSizer34->Add(ReglobalizeButton, 0, wxGROW|wxALL, 5); |
| 1143 |
> |
itemFrame1->SetMenuBar(menuBar); |
| 1144 |
|
|
| 1145 |
< |
// Connect events and objects |
| 1146 |
< |
Mods_CheckboxList->Connect(Mods_CheckboxList1, wxEVT_CREATE, wxWindowCreateEventHandler(MainWindow::ModList_OnCreate), NULL, this); |
| 1145 |
> |
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); |
| 1146 |
> |
itemFrame1->SetSizer(itemBoxSizer2); |
| 1147 |
> |
|
| 1148 |
> |
MainSplitter = new wxSplitterWindow( itemFrame1, ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(100, 100), wxSP_LIVE_UPDATE|wxNO_BORDER ); |
| 1149 |
> |
MainSplitter->SetMinimumPaneSize(1); |
| 1150 |
> |
MainSplitter->SetName(_T("MainSplitter")); |
| 1151 |
> |
|
| 1152 |
> |
wxPanel* itemPanel4 = new wxPanel( MainSplitter, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); |
| 1153 |
> |
wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL); |
| 1154 |
> |
itemPanel4->SetSizer(itemBoxSizer5); |
| 1155 |
> |
|
| 1156 |
> |
wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL); |
| 1157 |
> |
itemBoxSizer5->Add(itemBoxSizer6, 0, wxGROW|wxALL, 0); |
| 1158 |
> |
SelectAll = new wxCheckBox( itemPanel4, SelectAll_Checkbox, _("Select All/None"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE ); |
| 1159 |
> |
SelectAll->SetValue(false); |
| 1160 |
> |
SelectAll->SetName(_T("SelectAll_Checkbox")); |
| 1161 |
> |
itemBoxSizer6->Add(SelectAll, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); |
| 1162 |
> |
|
| 1163 |
> |
RefreshButton = new wxBitmapButton( itemPanel4, Refresh_Button, itemFrame1->GetBitmapResource(wxT("undo.xpm")), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); |
| 1164 |
> |
RefreshButton->SetName(_T("RefreshButton")); |
| 1165 |
> |
itemBoxSizer6->Add(RefreshButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); |
| 1166 |
> |
|
| 1167 |
> |
wxArrayString Mods_CheckboxListStrings; |
| 1168 |
> |
Mods_CheckboxList = new wxCheckListBox( itemPanel4, Mods_CheckboxList1, wxDefaultPosition, wxDefaultSize, Mods_CheckboxListStrings, wxLB_HSCROLL ); |
| 1169 |
> |
Mods_CheckboxList->SetName(_T("Mods_CheckboxList")); |
| 1170 |
> |
itemBoxSizer5->Add(Mods_CheckboxList, 1, wxGROW|wxALL, 0); |
| 1171 |
> |
|
| 1172 |
> |
wxPanel* itemPanel10 = new wxPanel( MainSplitter, DescriptionHolder_Panel, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); |
| 1173 |
> |
itemPanel10->SetName(_T("DescriptionHolder_Panel")); |
| 1174 |
> |
wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL); |
| 1175 |
> |
itemPanel10->SetSizer(itemBoxSizer11); |
| 1176 |
> |
|
| 1177 |
> |
wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL); |
| 1178 |
> |
itemBoxSizer11->Add(itemBoxSizer12, 0, wxGROW|wxALL, 0); |
| 1179 |
> |
wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL); |
| 1180 |
> |
itemBoxSizer12->Add(itemBoxSizer13, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0); |
| 1181 |
> |
titleText = new wxTextCtrl( itemPanel10, Title_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); |
| 1182 |
> |
titleText->SetName(_T("Title_Text")); |
| 1183 |
> |
titleText->SetBackgroundColour(wxColour(240, 240, 240)); |
| 1184 |
> |
itemBoxSizer13->Add(titleText, 1, wxGROW|wxLEFT, 5); |
| 1185 |
> |
|
| 1186 |
> |
wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxVERTICAL); |
| 1187 |
> |
itemBoxSizer12->Add(itemBoxSizer15, 1, wxGROW|wxALL, 0); |
| 1188 |
> |
creatorText = new wxTextCtrl( itemPanel10, Author_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_RIGHT ); |
| 1189 |
> |
creatorText->SetName(_T("Author_Text")); |
| 1190 |
> |
creatorText->SetBackgroundColour(wxColour(240, 240, 240)); |
| 1191 |
> |
itemBoxSizer15->Add(creatorText, 1, wxGROW|wxRIGHT, 5); |
| 1192 |
> |
|
| 1193 |
> |
wxStaticLine* itemStaticLine17 = new wxStaticLine( itemPanel10, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); |
| 1194 |
> |
itemStaticLine17->Show(false); |
| 1195 |
> |
itemBoxSizer11->Add(itemStaticLine17, 0, wxGROW|wxALL, 5); |
| 1196 |
> |
|
| 1197 |
> |
descriptionText = new wxTextCtrl( itemPanel10, Description_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH|wxTE_RICH2 ); |
| 1198 |
> |
descriptionText->SetName(_T("DescriptionName")); |
| 1199 |
> |
descriptionText->SetBackgroundColour(wxColour(240, 240, 240)); |
| 1200 |
> |
itemBoxSizer11->Add(descriptionText, 1, wxGROW|wxLEFT|wxRIGHT, 5); |
| 1201 |
> |
|
| 1202 |
> |
MainSplitter->SplitVertically(itemPanel4, itemPanel10, 200); |
| 1203 |
> |
itemBoxSizer2->Add(MainSplitter, 1, wxGROW|wxALL, 0); |
| 1204 |
> |
|
| 1205 |
> |
StatusArea = new wxStatusBar( itemFrame1, ID_STATUSBAR, 0 ); |
| 1206 |
> |
StatusArea->SetName(_T("StatusArea")); |
| 1207 |
> |
StatusArea->SetFieldsCount(1); |
| 1208 |
> |
StatusArea->SetStatusText(_("AE Installer v1.0.1"), 0); |
| 1209 |
> |
itemBoxSizer2->Add(StatusArea, 0, wxGROW|wxALL, 0); |
| 1210 |
> |
|
| 1211 |
> |
wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL); |
| 1212 |
> |
itemBoxSizer2->Add(itemBoxSizer20, 0, wxGROW|wxALL, 0); |
| 1213 |
> |
|
| 1214 |
> |
ProgressBar = new wxGauge( itemFrame1, ProgressBar_Gauge, 1000, wxDefaultPosition, wxDefaultSize, wxGA_SMOOTH ); |
| 1215 |
> |
ProgressBar->SetValue(0); |
| 1216 |
> |
itemBoxSizer20->Add(ProgressBar, 1, wxGROW|wxALL, 0); |
| 1217 |
> |
|
| 1218 |
> |
InstallButton = new wxButton( itemFrame1, Install_Button, _("Install!"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 1219 |
> |
itemBoxSizer20->Add(InstallButton, 0, wxGROW|wxALL, 0); |
| 1220 |
> |
|
| 1221 |
> |
wxBoxSizer* itemBoxSizer23 = new wxBoxSizer(wxVERTICAL); |
| 1222 |
> |
itemBoxSizer2->Add(itemBoxSizer23, 0, wxGROW|wxALL, 0); |
| 1223 |
> |
|
| 1224 |
> |
OptionsPanel = new wxPanel( itemFrame1, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); |
| 1225 |
> |
itemBoxSizer2->Add(OptionsPanel, 0, wxGROW, 0); |
| 1226 |
> |
|
| 1227 |
> |
wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxHORIZONTAL); |
| 1228 |
> |
OptionsPanel->SetSizer(itemBoxSizer25); |
| 1229 |
> |
|
| 1230 |
> |
wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxVERTICAL); |
| 1231 |
> |
itemBoxSizer25->Add(itemBoxSizer26, 0, wxGROW|wxALL, 5); |
| 1232 |
> |
|
| 1233 |
> |
SepRadio = new wxRadioButton( OptionsPanel, Sep_RadioButton, _("Sep"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); |
| 1234 |
> |
SepRadio->SetValue(false); |
| 1235 |
> |
if (MainWindow::ShowToolTips()) |
| 1236 |
> |
SepRadio->SetToolTip(_("For PC Demo and Mac")); |
| 1237 |
> |
itemBoxSizer26->Add(SepRadio, 0, wxALIGN_LEFT|wxALL, 5); |
| 1238 |
> |
|
| 1239 |
> |
NoSepRadio = new wxRadioButton( OptionsPanel, NoSep_RadioButton, _("NoSep"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 1240 |
> |
NoSepRadio->SetValue(false); |
| 1241 |
> |
if (MainWindow::ShowToolTips()) |
| 1242 |
> |
NoSepRadio->SetToolTip(_("For PC Retail")); |
| 1243 |
> |
itemBoxSizer26->Add(NoSepRadio, 0, wxALIGN_LEFT|wxALL, 5); |
| 1244 |
> |
|
| 1245 |
> |
wxStaticLine* itemStaticLine29 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); |
| 1246 |
> |
itemBoxSizer25->Add(itemStaticLine29, 0, wxGROW|wxALL, 5); |
| 1247 |
> |
|
| 1248 |
> |
wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxVERTICAL); |
| 1249 |
> |
itemBoxSizer25->Add(itemBoxSizer30, 0, wxGROW|wxALL, 5); |
| 1250 |
> |
|
| 1251 |
> |
SeperatedRadio = new wxRadioButton( OptionsPanel, Seperated_RadioButton, _("Separated Level0"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); |
| 1252 |
> |
SeperatedRadio->SetValue(false); |
| 1253 |
> |
SeperatedRadio->SetName(_T("Seperated_RadioButton")); |
| 1254 |
> |
itemBoxSizer30->Add(SeperatedRadio, 0, wxALIGN_LEFT|wxALL, 5); |
| 1255 |
> |
|
| 1256 |
> |
CompleteRadio = new wxRadioButton( OptionsPanel, Complete_RadioButton, _("Complete Level0"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 1257 |
> |
CompleteRadio->SetValue(false); |
| 1258 |
> |
CompleteRadio->SetName(_T("Complete_RadioButton")); |
| 1259 |
> |
itemBoxSizer30->Add(CompleteRadio, 0, wxALIGN_LEFT|wxALL, 5); |
| 1260 |
> |
|
| 1261 |
> |
wxStaticLine* itemStaticLine33 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); |
| 1262 |
> |
itemBoxSizer25->Add(itemStaticLine33, 0, wxGROW|wxALL, 5); |
| 1263 |
> |
|
| 1264 |
> |
wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxVERTICAL); |
| 1265 |
> |
itemBoxSizer25->Add(itemBoxSizer34, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); |
| 1266 |
> |
|
| 1267 |
> |
ReglobalizeButton = new wxButton( OptionsPanel, ReGlobalize_Button, _("Reglobalize"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 1268 |
> |
ReglobalizeButton->SetName(_T("Reglobalize_Button")); |
| 1269 |
> |
itemBoxSizer34->Add(ReglobalizeButton, 0, wxGROW|wxALL, 5); |
| 1270 |
> |
|
| 1271 |
> |
// Connect events and objects |
| 1272 |
> |
Mods_CheckboxList->Connect(Mods_CheckboxList1, wxEVT_CREATE, wxWindowCreateEventHandler(MainWindow::ModList_OnCreate), NULL, this); |
| 1273 |
|
////@end MainWindow content construction |
| 1274 |
+ |
#ifdef WIN32 |
| 1275 |
+ |
Handle = (HWND)GetHWND(); |
| 1276 |
+ |
::CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_ITaskbarList, (void **)&pTaskbarList); |
| 1277 |
+ |
#endif |
| 1278 |
+ |
|
| 1279 |
|
|
| 1280 |
< |
if ( exists( "../../GameDataFolder/level0_Final.sep" ) ) { |
| 1281 |
< |
static_cast<string>("-import:sep"); |
| 1280 |
> |
/*if ( exists( "../../GameDataFolder/level0_Final.sep" ) ) { |
| 1281 |
> |
strImportOption = "-import:sep"; |
| 1282 |
|
splitInstances = NOT_SPLIT; |
| 1283 |
|
} |
| 1284 |
|
else { |
| 1285 |
< |
static_cast<string>("-import:nosep"); |
| 1285 |
> |
strImportOption = "-import:nosep"; |
| 1286 |
|
splitInstances = SPLIT; |
| 1287 |
< |
} |
| 1287 |
> |
}*/ |
| 1288 |
> |
|
| 1289 |
> |
|
| 1290 |
> |
#ifndef WIN32 |
| 1291 |
> |
strImportOption = "-import:sep"; |
| 1292 |
> |
splitInstances = NOT_SPLIT; |
| 1293 |
> |
#else |
| 1294 |
> |
strImportOption = "-import:nosep"; |
| 1295 |
> |
splitInstances = SPLIT; |
| 1296 |
> |
#endif |
| 1297 |
|
|
| 1298 |
+ |
#ifndef WIN32 |
| 1299 |
+ |
strImportOption = "-import:sep"; |
| 1300 |
+ |
splitInstances = NOT_SPLIT; |
| 1301 |
+ |
#else |
| 1302 |
+ |
strImportOption = "-import:nosep"; |
| 1303 |
+ |
splitInstances = SPLIT; |
| 1304 |
+ |
#endif |
| 1305 |
+ |
|
| 1306 |
|
globalPackages = getPackages(); |
| 1307 |
|
globalInstalledMods = getInstallString(); |
| 1308 |
< |
for (int i = 0; i < globalPackages.size(); i++) { |
| 1308 |
> |
for (unsigned int i = 0; i < globalPackages.size(); i++) { |
| 1309 |
|
Mods_CheckboxList->Append(globalPackages[i].name.c_str()); |
| 1310 |
|
if( binary_search(globalInstalledMods.begin(), globalInstalledMods.end(), globalPackages[i].modStringName ) ) Mods_CheckboxList->Check(i); |
| 1311 |
|
} |
| 1314 |
|
TheInstallButton = InstallButton; |
| 1315 |
|
TheProgressBar = ProgressBar; |
| 1316 |
|
OptionsPanel->Hide(); |
| 1317 |
< |
if(splitInstances == SPLIT) SeparatedRadio->SetValue(true); |
| 1317 |
> |
|
| 1318 |
> |
//#ifndef WIN32 |
| 1319 |
> |
// itemMenu37->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL); |
| 1320 |
> |
|
| 1321 |
> |
//#endif |
| 1322 |
> |
|
| 1323 |
> |
if(splitInstances == SPLIT) SeperatedRadio->SetValue(true); |
| 1324 |
|
else CompleteRadio->SetValue(true); |
| 1135 |
– |
|
| 1136 |
– |
|
| 1137 |
– |
|
| 1325 |
|
if(strImportOption == "-import:nosep") NoSepRadio->SetValue(true); |
| 1326 |
|
else SepRadio->SetValue(true); |
| 1327 |
|
|
| 1344 |
|
{ |
| 1345 |
|
switch(SelectAll->Get3StateValue()) { |
| 1346 |
|
case wxCHK_UNCHECKED: |
| 1347 |
< |
for(int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, false); |
| 1347 |
> |
for(unsigned int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, false); |
| 1348 |
|
//SelectAll->Set3StateValue(wxCHK_CHECKED); |
| 1349 |
|
break; |
| 1350 |
|
case wxCHK_CHECKED: |
| 1351 |
< |
for(int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, true); |
| 1351 |
> |
for(unsigned int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, true); |
| 1352 |
|
//SelectAll->Set3StateValue(wxCHK_UNCHECKED); |
| 1353 |
|
break; |
| 1354 |
|
case wxCHK_UNDETERMINED: |
| 1355 |
< |
for(int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, false); |
| 1355 |
> |
for(unsigned int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, false); |
| 1356 |
|
//SelectAll->Set3StateValue(wxCHK_CHECKED); |
| 1357 |
|
break; |
| 1358 |
|
|
| 1389 |
|
{ |
| 1390 |
|
// Bitmap retrieval |
| 1391 |
|
////@begin MainWindow bitmap retrieval |
| 1392 |
< |
wxUnusedVar(name); |
| 1393 |
< |
if (name == _T("redo.xpm")) |
| 1394 |
< |
{ |
| 1395 |
< |
wxBitmap bitmap(redo_xpm); |
| 1396 |
< |
return bitmap; |
| 1397 |
< |
} |
| 1398 |
< |
else if (name == _T("fileopen.xpm")) |
| 1399 |
< |
{ |
| 1400 |
< |
wxBitmap bitmap( fileopen_xpm); |
| 1401 |
< |
return bitmap; |
| 1402 |
< |
} |
| 1403 |
< |
else if (name == _T("filesaveas.xpm")) |
| 1404 |
< |
{ |
| 1405 |
< |
wxBitmap bitmap( filesaveas_xpm); |
| 1406 |
< |
return bitmap; |
| 1407 |
< |
} |
| 1408 |
< |
else if (name == _T("quit.xpm")) |
| 1409 |
< |
{ |
| 1410 |
< |
wxBitmap bitmap( quit_xpm); |
| 1411 |
< |
return bitmap; |
| 1412 |
< |
} |
| 1413 |
< |
return wxNullBitmap; |
| 1392 |
> |
wxUnusedVar(name); |
| 1393 |
> |
if (name == _T("undo.xpm")) |
| 1394 |
> |
{ |
| 1395 |
> |
wxBitmap bitmap( undo_xpm); |
| 1396 |
> |
return bitmap; |
| 1397 |
> |
} |
| 1398 |
> |
else if (name == _T("fileopen.xpm")) |
| 1399 |
> |
{ |
| 1400 |
> |
wxBitmap bitmap( fileopen_xpm); |
| 1401 |
> |
return bitmap; |
| 1402 |
> |
} |
| 1403 |
> |
else if (name == _T("filesaveas.xpm")) |
| 1404 |
> |
{ |
| 1405 |
> |
wxBitmap bitmap( filesaveas_xpm); |
| 1406 |
> |
return bitmap; |
| 1407 |
> |
} |
| 1408 |
> |
else if (name == _T("quit.xpm")) |
| 1409 |
> |
{ |
| 1410 |
> |
wxBitmap bitmap( quit_xpm); |
| 1411 |
> |
return bitmap; |
| 1412 |
> |
} |
| 1413 |
> |
return wxNullBitmap; |
| 1414 |
|
////@end MainWindow bitmap retrieval |
| 1415 |
|
} |
| 1416 |
|
|
| 1423 |
|
|
| 1424 |
|
// Icon retrieval |
| 1425 |
|
////@begin MainWindow icon retrieval |
| 1426 |
< |
wxUnusedVar(name); |
| 1427 |
< |
if (name == _T("oni_special.ico")) |
| 1428 |
< |
{ |
| 1429 |
< |
// wxIcon icon(_T("oni_special.ico"), wxBITMAP_TYPE_ICO); |
| 1430 |
< |
// return icon; |
| 1431 |
< |
} |
| 1432 |
< |
return wxNullIcon; |
| 1426 |
> |
wxUnusedVar(name); |
| 1427 |
> |
if (name == _T("aelogosmall.png")) |
| 1428 |
> |
{ |
| 1429 |
> |
wxIcon icon(aelogosmall_xpm); |
| 1430 |
> |
return icon; |
| 1431 |
> |
} |
| 1432 |
> |
return wxNullIcon; |
| 1433 |
|
////@end MainWindow icon retrieval |
| 1434 |
|
} |
| 1435 |
|
|
| 1479 |
|
{ |
| 1480 |
|
if (!event.GetInt() ) { |
| 1481 |
|
OptionsPanel->Hide(); |
| 1482 |
+ |
|
| 1483 |
|
this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight());} |
| 1484 |
|
else { |
| 1485 |
|
// Uncomment this when we release, it gets annoying if you are testing globalization a lot ;) |
| 1516 |
|
TheInstallButton->Disable(); |
| 1517 |
|
recompileAll(thePackages); |
| 1518 |
|
TheInstallButton->Enable(); |
| 1519 |
+ |
|
| 1520 |
|
} |
| 1521 |
|
|
| 1522 |
|
vector<string> thePackages; |
| 1523 |
|
}; |
| 1524 |
|
|
| 1525 |
+ |
void globalize2(void) { |
| 1526 |
+ |
TheInstallButton->Disable(); |
| 1527 |
+ |
globalizeData(); |
| 1528 |
+ |
TheInstallButton->Enable(); |
| 1529 |
+ |
} |
| 1530 |
+ |
|
| 1531 |
+ |
|
| 1532 |
+ |
|
| 1533 |
|
void MainWindow::OnInstallButtonClick( wxCommandEvent& event ) |
| 1534 |
|
{ |
| 1535 |
|
|
| 1536 |
|
vector<string> localPackages; |
| 1537 |
< |
localPackages.push_back("Globalize"); |
| 1538 |
< |
for(int i = 0; i < globalPackages.size(); i++) if(Mods_CheckboxList->IsChecked(i)) localPackages.push_back( globalPackages[i].modStringName ); |
| 1537 |
> |
localPackages.push_back("00000Globalize"); |
| 1538 |
> |
for(unsigned int i = 0; i < globalPackages.size(); i++) if(Mods_CheckboxList->IsChecked(i)) localPackages.push_back( globalPackages[i].modStringName ); |
| 1539 |
|
if ( !localPackages.empty() ) { |
| 1540 |
< |
|
| 1540 |
> |
sort(localPackages.begin(), localPackages.end()); |
| 1541 |
> |
localPackages[0] = "Globalize"; |
| 1542 |
|
//MainWindow::MainWindow().Hide(); |
| 1543 |
|
// boost::thread thrd2(recompileAll(localPackages) ); |
| 1544 |
|
//MainWindow::MainWindow().Show(); |
| 1572 |
|
|
| 1573 |
|
void setProgressBar( int i ) { |
| 1574 |
|
//TheProgressBar->SetValue( |
| 1575 |
+ |
#ifdef WIN32 |
| 1576 |
+ |
|
| 1577 |
+ |
|
| 1578 |
+ |
|
| 1579 |
+ |
if (SUCCEEDED(pTaskbarList->QueryInterface(IID_ITaskbarList3, (void **)&pTaskbarList3))) |
| 1580 |
+ |
{ |
| 1581 |
+ |
|
| 1582 |
+ |
pTaskbarList3->SetProgressValue(Handle,i, 1000); |
| 1583 |
+ |
if ( i == 0 ) { |
| 1584 |
|
|
| 1585 |
+ |
pTaskbarList3->SetProgressState(Handle,TBPF_NOPROGRESS); |
| 1586 |
+ |
} |
| 1587 |
+ |
} |
| 1588 |
+ |
|
| 1589 |
+ |
|
| 1590 |
+ |
#endif |
| 1591 |
|
TheProgressBar->SetValue(i); |
| 1592 |
|
|
| 1593 |
|
} |
| 1600 |
|
void MainWindow::OnStatusbarUpdate( wxUpdateUIEvent& event ) |
| 1601 |
|
{ |
| 1602 |
|
////@begin wxEVT_UPDATE_UI event handler for ID_STATUSBAR in MainWindow. |
| 1603 |
< |
// Before editing this code, remove the block markers. |
| 1604 |
< |
event.Skip(); |
| 1603 |
> |
// Before editing this code, remove the block markers. |
| 1604 |
> |
event.Skip(); |
| 1605 |
|
////@end wxEVT_UPDATE_UI event handler for ID_STATUSBAR in MainWindow. |
| 1606 |
|
} |
| 1607 |
|
|
| 1613 |
|
void MainWindow::OnAboutClick( wxCommandEvent& event ) |
| 1614 |
|
{ |
| 1615 |
|
////@begin wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow. |
| 1616 |
< |
// Before editing this code, remove the block markers. |
| 1617 |
< |
About* window = new About(this); |
| 1618 |
< |
int returnValue = window->ShowModal(); |
| 1619 |
< |
window->Destroy(); |
| 1616 |
> |
// Before editing this code, remove the block markers. |
| 1617 |
> |
About* window = new About(this); |
| 1618 |
> |
int returnValue = window->ShowModal(); |
| 1619 |
> |
window->Destroy(); |
| 1620 |
|
////@end wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow. |
| 1621 |
|
} |
| 1622 |
|
|
| 1645 |
|
* wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton |
| 1646 |
|
*/ |
| 1647 |
|
|
| 1435 |
– |
void MainWindow::OnSeparatedRadioButtonSelected( wxCommandEvent& event ) |
| 1436 |
– |
{ |
| 1437 |
– |
splitInstances = SPLIT; |
| 1438 |
– |
|
| 1439 |
– |
} |
| 1440 |
– |
|
| 1441 |
– |
|
| 1648 |
|
/* |
| 1649 |
|
* wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Complete_RadioButton |
| 1650 |
|
*/ |
| 1677 |
|
|
| 1678 |
|
Mods_CheckboxList->Clear(); |
| 1679 |
|
//globalInstalledMods = getPackages(); |
| 1680 |
< |
for (int i = 0; i < globalPackages.size(); i++) { |
| 1680 |
> |
for (unsigned int i = 0; i < globalPackages.size(); i++) { |
| 1681 |
|
Mods_CheckboxList->Append(globalPackages[i].name.c_str()); |
| 1682 |
|
if( binary_search(s.begin(), s.end(), globalPackages[i].modStringName ) ) Mods_CheckboxList->Check(i); |
| 1683 |
|
//else Mods_CheckboxList->Check(i,0); |
| 1740 |
|
ofstream file(openFileDialog->GetPath().c_str()); |
| 1741 |
|
|
| 1742 |
|
vector<string>list; |
| 1743 |
< |
for(int i = 0; i < globalPackages.size(); i++) if(Mods_CheckboxList->IsChecked(i)) list.push_back( globalPackages[i].modStringName ); |
| 1743 |
> |
for(unsigned int i = 0; i < globalPackages.size(); i++) if(Mods_CheckboxList->IsChecked(i)) list.push_back( globalPackages[i].modStringName ); |
| 1744 |
|
vector<string>::iterator begin_iter = list.begin(); |
| 1745 |
|
vector<string>::iterator end_iter = list.end(); |
| 1746 |
|
|
| 1806 |
|
////@end wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton in MainWindow. |
| 1807 |
|
}*/ |
| 1808 |
|
|
| 1809 |
+ |
|
| 1810 |
+ |
/* |
| 1811 |
+ |
* wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Seperated_RadioButton |
| 1812 |
+ |
*/ |
| 1813 |
+ |
|
| 1814 |
+ |
void MainWindow::OnSeperatedRadioButtonSelected( wxCommandEvent& event ) |
| 1815 |
+ |
{ |
| 1816 |
+ |
splitInstances = SPLIT; |
| 1817 |
+ |
} |
| 1818 |
+ |
|