ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/AE/Installer/trunk/source/main_window.cpp
(Generate patch)

Comparing AE/Installer/trunk/source/main_window.cpp (file contents):
Revision 379 by iritscen, Mon Jun 29 19:23:42 2009 UTC vs.
Revision 469 by gumby, Tue Oct 20 22:55:16 2009 UTC

# Line 1 | Line 1
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
# Line 21 | Line 33
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
# Line 30 | Line 43
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;
# Line 52 | Line 65 | using namespace boost::filesystem;
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;
# Line 98 | Line 124 | int globalizeData(void)
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);
# Line 106 | Line 132 | int globalizeData(void)
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);
# Line 146 | Line 172 | int globalizeData(void)
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 );
# Line 170 | Line 195 | int globalizeData(void)
195                  }
196                  logfile << "Exporting and moving...\n\n";
197                  int total_steps =  8 + 2 * num_levels;
198 +        
199                  for(int i = 0; i < 15; i++)
200                  {
201  
# Line 183 | Line 209 | int globalizeData(void)
209                                  create_directory( "../GameDataFolder/level" + levels[i] + "_Final" );
210                                  //                              setStatusArea(strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat");
211                                  system((strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat").c_str());
212 <                                create_directory( "packages/VanillaDats/level" + levels[i] + "_Final" );
213 <                                create_directory( "packages/VanillaDats/level" + levels[i] + "_Final/level" + levels[i] + "_Final" );
212 >                                create_directory( "VanillaDats/level" + levels[i] + "_Final" );
213 >                                create_directory( "VanillaDats/level" + levels[i] + "_Final/level" + levels[i] + "_Final" );
214 >                                
215 >                                //Moves the AKEV and other files into a safe directory so that level specific textures are not globalized...
216 >                                if ( strcmp(levels[i].c_str(), "0") ){
217 >                                        create_directory( "../GameDataFolder/level" + levels[i] + "_Final/AKEV" );
218 >                                        system((strOniSplit + " -move:overwrite ../GameDataFolder/level" + levels[i] + "_Final/AKEV ../GameDataFolder/level" + levels[i] + "_Final/AKEV*.oni").c_str());
219 >
220 >                                }
221  
222                                  directory_iterator end_iter;
223                                  for ( directory_iterator dir_itr( "../GameDataFolder/level" + levels[i] + "_Final" ); dir_itr != end_iter; ++dir_itr )
# Line 207 | Line 240 | int globalizeData(void)
240                                                          else remove(dir_itr->path());
241                                                  }
242                                                  else if (dir_itr->path().filename().substr(0,4) == "TRAC"
243 <                                                        || dir_itr->path().filename().substr(0,4) == "ONVL") {
243 >                                                        ) {
244                                                                  cout <<dir_itr->path().filename() << "\n";
245                                                                  if(!exists( TRAC / dir_itr->filename())) rename(dir_itr->path(), TRAC / dir_itr->filename());
246                                                                  else remove(dir_itr->path());
# Line 227 | Line 260 | int globalizeData(void)
260                                                  else if (dir_itr->path().filename().substr(0,4) == "ONCC"
261                                                          || dir_itr->path().filename().substr(0,4) == "TRBS"
262                                                          || dir_itr->path().filename().substr(0,4) == "ONCV"
263 +                                                        || dir_itr->path().filename().substr(0,4) == "ONVL"
264                                                          || dir_itr->path().filename().substr(0,4) == "TRMA"
265                                                          || dir_itr->path().filename().substr(0,4) == "TRSC"
266                                                          || dir_itr->path().filename().substr(0,4) == "TRAS") {
# Line 261 | Line 295 | int globalizeData(void)
295                                                                  if(!exists( Archive / dir_itr->filename())) rename(dir_itr->path(), Archive / dir_itr->filename());
296                                                                  else remove(dir_itr->path());
297                                                  }
298 +                                                else if (dir_itr->path().filename().substr(0,4) == "ONWC") { //fix for buggy ONWC overriding
299 +                                                                cout <<dir_itr->path().filename() << "\n";
300 +
301 +                                                                if(!exists( "VanillaDats/level0_Final/level0_Final/" +  dir_itr->filename())) rename(dir_itr->path(), "VanillaDats/level0_Final/level0_Final/" +  dir_itr->filename());
302 +                                                                else remove(dir_itr->path());
303 +                                                }
304 +
305                                                  if (exists(dir_itr->path())) {
306  
307                                                  }
308                                                  else {
309 <                                                        //logfile << "\tMoved file: " << dir_itr->path().filename() << "\n";
309 >                                                        logfile << "\tMoved file: " << dir_itr->path().filename() << "\n";
310                                                  }
311                                          }
312  
313  
314  
315                                  }
316 +                                
317                                  logfile << "\tCleaning up TXMPs...\n";
318                                  system( (strOniSplit + " -move:delete " + Textures.string() + " ../GameDataFolder/level" + levels[i] + "_Final/TXMP*.oni").c_str());
319 +                                
320 +
321 +                                if ( strcmp(levels[i].c_str(), "0") ){
322 +                                        system((strOniSplit + " -move:overwrite ../GameDataFolder/level" + levels[i] + "_Final ../GameDataFolder/level" + levels[i] + "_Final/AKEV/AKEV*.oni").c_str());
323 +                                        remove(  "../GameDataFolder/level" + levels[i] + "_Final/AKEV" );
324 +                                }
325 +
326                                  parts_done++;
327  
328                                  setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) ));
# Line 287 | Line 336 | int globalizeData(void)
336                          //printf(levels[i],"%d",levels[i]);
337                          //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");
338                          setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + " reimporting level" + levels[i]+"_Final.oni");
339 <                        system( (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level"
340 <                                + levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize.log").c_str());
339 >                        logfile << (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final VanillaDats/level" + levels[i] + "_Final/level"
340 >                                + levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize.log").c_str() << '\n';
341 >                        string sys_str = (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final VanillaDats/level" + levels[i] + "_Final/level"
342 >                                + levels[i] + "_Final/level" + levels[i] + "_Final.oni");
343 >                                system(sys_str.c_str() );
344                          setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) ));
345                          parts_done++;
346                  }
347 <                create_directory( VanillaCharacters.parent_path() );
347 >                //create_directory( VanillaCharacters.parent_path() );
348                  create_directory( VanillaParticles.parent_path() );
349                  create_directory( VanillaTextures.parent_path() );
350                  create_directory( VanillaSounds.parent_path() );
351                  create_directory( VanillaAnimations.remove_filename() );
352  
353 <                for(int j = 0; j < GDFPaths.size(); j++) {
353 >                for(unsigned int j = 0; j < GDFPaths.size(); j++) {
354                          logfile << "\tReimporting " << GDFPaths[j].filename() << ".oni\n";
355                          setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + ": reimporting " + GDFPaths[j].filename() );
356                          system((strOniSplit + " " + strImportOption + " " + GDFPaths[j].string() + " " + VanillaPaths[j].string()).c_str());
357                          parts_done++;
358                          setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) ));
359                  }
360 +                logfile << "\nMoving level0_Characters\n";
361 +                setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + ": moving level0_Characters" );      
362 +                copy((path)"../GameDataFolder/level0_Characters", (path)("VanillaDats/level0_Final"));
363 +                GDFPaths.push_back( Characters );
364 +                for(int i = 0; i < GDFPaths.size(); i++)
365 +                {
366 +                        directory_iterator end_iter;
367 +                        for ( directory_iterator dir_itr( GDFPaths[i] ); dir_itr != end_iter; ++dir_itr )
368 +                        {
369 +                                try
370 +                                {
371 +
372 +
373 +                                        rename(dir_itr->path(), "../GameDataFolder/level0_Final/" + dir_itr->path().filename() );
374 +                                }
375 +                                catch(exception &ex) {
376 +
377 +                                }
378 +                        }
379 +                }
380                  /*
381                  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) ));
382                  system((strOniSplit + " " + strImportOption + " " + Characters.string() + " " + VanillaCharacters.string()).c_str());
# Line 325 | Line 397 | int globalizeData(void)
397                  create_directory((path)"../GameDataFolder/IGMD");
398                  copy((path)"packages/VanillaBSL/IGMD", (path)"../GameDataFolder");
399                  setProgressBar( 1000 );
400 +
401 +                if(exists("../../persist.dat")) if(!exists("../persist.dat"))
402                  
403 <                // 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/
404 <                
405 <                // CIP:then copy persist.dat and keyconfig.txt into edition/ as well
403 >                        //TODO: Concactate level0 Dirs.
404 >
405 >                        copy("../../persist.dat","..");
406 >                if(exists("../../key_config.txt"))if(!exists("../key_config.txt"))
407 >                        copy("../../key_config.txt","..");
408                  
409   #ifndef WIN32
410                  /* 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).
411 <                   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,
412 <                   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 */
413 <                path fullAEpath = system_complete("."); // get full path for Installer
414 <                char prefsCommand[300] = "defaults write com.godgames.oni RetailInstallationPath -string '";
415 <                strcat(prefsCommand, fullAEpath.parent_path().parent_path().string().c_str()); // get path of edition/ folder (Oni wants the folder that *contains* the GDF)
411 >                   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
412 >                   run Oni before :-p */
413 >                string fullAEpath = escapePath(system_complete(".").parent_path().parent_path().string()); // get full path for edition/
414 >                char prefsCommand[300] = "[ -f ~/Library/Preferences/com.godgames.oni.plist ] && defaults write com.godgames.oni RetailInstallationPath -string '";
415 >                strcat(prefsCommand, fullAEpath.c_str()); // get path of edition/ folder (Oni wants the folder that *contains* the GDF)
416                  strcat(prefsCommand, "'"); // path string is enclosed in single quotes to avoid the need to escape UNIX-unfriendly characters
417                  system(prefsCommand);
418                  
419   #endif
420                  
421 +                
422                  setStatusArea((string)"Done! Now select your mod packages and click install.");
423                  //      while(1) Sleep(-1);
424  
425          }
426 <        catch (exception ex) {
426 >        catch (exception & ex) {
427                  setStatusArea("Warning, handled exception: " + (string)ex.what());
428          }
429  
# Line 370 | Line 447 | vector<ModPackage> getPackages(void)
447  
448          try
449          {
450 <                directory_iterator end_iter;
374 <                for (directory_iterator dir_itr("./packages"); dir_itr != end_iter; ++dir_itr)
450 >                for (directory_iterator dir_itr("./packages"), end_itr; dir_itr != end_itr; ++dir_itr)
451                  {
452                          file.open((dir_itr->path().string() + "/" + MODINFO_CFG).c_str());
453                          //cout << filename << "\n";
# Line 450 | Line 526 | ModPackage fileToModPackage(fstream &fil
526                          }
527                          else if (!HasOnis.compare(*iter)) {
528                                  iter++; iter++;  
529 <                                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
530 <                                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,
531 <                                        iter++; iter++;}  // using "YFR" would probably set it off. :<
532 <
533 <                                if (toupper((*iter)[0]) + toupper((*iter)[1]) + toupper((*iter)[2]) == 'Y' + 'E' + 'S') package.hasBSL = 1;
529 >                                if ( boost::iequals(*iter, "Yes")) package.hasOnis = 1;
530 >                        }      
531 >                        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,
532 >                                iter++; iter++;  // using "YFR" would probably set it off. :<
533 >                                if ( boost::iequals(*iter, "Yes")) package.hasBSL = 1;
534 >                                else if ( boost::iequals(*iter, "Addon")) package.hasAddon = 1;
535                          }
536                          else if (!HasDeltas.compare(*iter)) {
537                                  iter++; iter++;  
# Line 480 | Line 557 | ModPackage fileToModPackage(fstream &fil
557                                                  //cout << " ";
558                                                  package.category += *iter + " ";
559                                          }
483                                }
560                          }
561 <                        else if (!Creator.compare(*iter))  {    //if it contains the name
562 <                                for ( ; iter !=tokens.end() && SLASHSLASH.compare(*iter); iter++) {     //interates through the words, ends if it reaches the end of the line or a "//" comment
563 <                                        if (ARROW.compare(*iter) && Creator.compare(*iter)) {                   //ignores "->" and "Category"
564 <                                                //cout << *iter;
565 <                                                //cout << " ";
566 <                                                package.creator += *iter + " ";
567 <                                        }
561 >                }
562 >                else if (!Creator.compare(*iter))  {    //if it contains the name
563 >                        for ( ; iter !=tokens.end() && SLASHSLASH.compare(*iter); iter++) {     //interates through the words, ends if it reaches the end of the line or a "//" comment
564 >                                if (ARROW.compare(*iter) && Creator.compare(*iter)) {                   //ignores "->" and "Category"
565 >                                        //cout << *iter;
566 >                                        //cout << " ";
567 >                                        package.creator += *iter + " ";
568                                  }
569                          }
570 <                        else if (!Readme.compare(*iter))  {     //if it contains the name
571 <                                for ( ; iter !=tokens.end() && SLASHSLASH.compare(*iter); iter++) {     //interates through the words, ends if it reaches the end of the line or a "//" comment
572 <                                        if (ARROW.compare(*iter) && Readme.compare(*iter)) {                    //ignores "->" and "Category"
573 <                                                if(!(*iter).compare("\\n")) package.readme += '\n';
574 <                                                else package.readme += *iter + " ";
575 <                                        }
570 >                }
571 >                else if (!Readme.compare(*iter))  {     //if it contains the name
572 >                        for ( ; iter !=tokens.end() && SLASHSLASH.compare(*iter); iter++) {     //interates through the words, ends if it reaches the end of the line or a "//" comment
573 >                                if (ARROW.compare(*iter) && Readme.compare(*iter)) {                    //ignores "->" and "Category"
574 >                                        if(!(*iter).compare("\\n")) package.readme += '\n';
575 >                                        else package.readme += *iter + " ";
576                                  }
577                          }
578                  }
503
579          }
580 <        package.doOutput();
581 <        return package;
580 >
581 > }
582 > package.doOutput();
583 > return package;
584   }
585  
586   void recompileAll(vector<string> installedMods)
587 < {
587 > {try {
588          busy = 1;
589          using namespace boost::gregorian;
590          using namespace boost::posix_time;
591          using boost::lexical_cast;
592          using boost::bad_lexical_cast;
593 <        
517 <        setStatusArea("Importing levels...");
518 <        //setStatusArea("Recompiling Data...");
519 <        path vanilla_dir = "./packages/VanillaDats/";
593 >                path vanilla_dir = "./VanillaDats/";
594          string importCommand = "";
595          char statusString[128];
596          int numberOfDats = 0;
597          int j = 1;
598          string datString;
599 +        
600 +
601 +        setStatusArea("Importing levels...");
602 +        //setStatusArea("Recompiling Data...");
603 +
604          std::stringstream out;
605  
606          ptime start_time(second_clock::local_time());
607          clearOldDats();
608 <        remove("Install.log");
608 >        
609 >        if(exists("Install.log")) remove("Install.log");
610          ofstream logfile("Install.log");
611          logfile << "Mod Installation started " << to_simple_string(start_time) << endl;
612          logfile.close();
613 +
614 +
615          if(splitInstances == SPLIT){
616                  recursive_directory_iterator end_iter;
617  
# Line 543 | Line 625 | void recompileAll(vector<string> install
625                                          numberOfDats++;
626                                  }
627                          }
628 <                        catch(exception ex) {
628 >                        catch(exception & ex) {
629 >                                        remove("Install.log");
630 >                                        ofstream logfile("Install.log");
631  
632 +
633 +                                        logfile << "Warning, exception " << ex.what() << "!";
634 +                                        setStatusArea("Warning, exception " + (string)ex.what() + "!");
635 +                                        logfile.close();        
636                          }
637                  }
638 <
638 >                try {
639                  //recursive_directory_iterator end_iter;
640 <
640 >                
641  
642                  out << numberOfDats;
643                  datString = out.str();
556                try {
644                          for ( recursive_directory_iterator dir_itr( vanilla_dir );
645                                  dir_itr != end_iter;
646                                  ++dir_itr )
# Line 563 | Line 650 | void recompileAll(vector<string> install
650                                          if ( is_directory( dir_itr->status() ) &&  dir_itr.level() == 1)
651                                          {
652                                                  importCommand = strOniSplit + " " + strImportOption + " " + dir_itr->path().parent_path().string() + '/' + dir_itr->path().filename();
653 <                                                for (int i = 0; i < installedMods.size(); ++i) {
653 >                                                for (unsigned int i = 0; i < installedMods.size(); ++i) {
654                                                          if (exists("packages/" + installedMods[i] + "/oni/" + dir_itr->path().parent_path().filename() + '/' + dir_itr->path().filename()  ))
655                                                                  importCommand += " packages/" + installedMods[i] + "/oni/" + dir_itr->path().parent_path().filename() + '/' + dir_itr->path().filename();
656  
657 <                                                        //else cout << " packages/VanillaDats/" + installedMods[i] + "/oni/";
657 >                                                        //else cout << " VanillaDats/" + installedMods[i] + "/oni/";
658                                                  }
659                                                  importCommand += " ../GameDataFolder/" + dir_itr->path().filename() + ".dat >> Install.log";
660  
# Line 635 | Line 722 | void recompileAll(vector<string> install
722                          {
723                                  if ( is_directory( dir_itr->status() ) )
724                                  {
725 <                                        importCommand = strOniSplit + " " + strImportOption + " " + vanilla_dir.string() + dir_itr->path().filename() + " " + "../GameDataFolder/" + dir_itr->path().filename()
726 <                                                + ".dat";
640 <                                        for (int i = 0; i < installedMods.size(); ++i) {
725 >                                        importCommand = strOniSplit + " " + strImportOption + " " + vanilla_dir.string() + dir_itr->path().filename() + " ";
726 >                                        for (unsigned int i = 0; i < installedMods.size(); ++i) {
727                                                  if (exists("packages/" + installedMods[i] + "/oni/" + dir_itr->path().filename()  ))
728                                                          importCommand += " packages/" + installedMods[i] + "/oni/" + dir_itr->path().filename();
729                                          }
# Line 664 | Line 750 | void recompileAll(vector<string> install
750                                  logfile.close();
751                          }}
752          }
753 +
754 +
755 +
756 +        
757 +
758 +
759 +
760 +
761 +                
762 +                
763 +                vector<string> BSLfolders;
764 +                vector<string> skippedfolders;
765 +
766 +                
767 + ofstream BSLlog("BSL.log");
768 +                for ( directory_iterator dir_itr( "../GameDataFolder/IGMD/" ), end_itr;
769 +                        dir_itr != end_itr;
770 +                        ++dir_itr ) {
771 +                                if( exists(dir_itr->path().string() + "/ignore.txt") ){
772 +                                        BSLfolders.push_back(dir_itr->path().filename());
773 +                                        skippedfolders.push_back(dir_itr->path().filename());
774 +                                }
775 +                }
776 +
777 +                for (int i = installedMods.size() - 1; i >= 0; i--) {                                                   //Iterates through the installed mods (backwards :P)
778 +                        for (unsigned int j = 0; j < globalPackages.size(); ++j) {                              //looking in the global packages
779 +                                if (globalPackages[j].modStringName == installedMods[i]) {      //for a mod that has BSL in it
780 +                                /*BSLlog << "Testing " << globalPackages[j].modStringName << "\n"
781 +                                                << "HasBSL: " << globalPackages[j].hasBSL << "\n"
782 +                                                << "HasAddon: " << globalPackages[j].hasAddon << "\n";*/
783 +                                        if(!(globalPackages[j].hasAddon || globalPackages[j].hasBSL)) break; //skip non-BSL
784 +                                        if( exists( "packages/" + globalPackages[j].modStringName + "/BSL/" ) ) {
785 +                                        copyBSL("packages/" + globalPackages[j].modStringName + "/BSL", BSLfolders, globalPackages[j] );
786 +                                        BSLlog << "Copied " <<  globalPackages[j].modStringName << "!\n";
787 +                                        }
788 +
789 +                                }
790 +
791 +                        }
792 +                }
793 +
794 +                ModPackage emptyPackage;
795 +                emptyPackage.modStringName = "VanillaBSL";
796 +                emptyPackage.hasBSL = 1;
797 +                copyBSL("packages/VanillaBSL/IGMD", BSLfolders, emptyPackage);
798 +                BSLlog.close();
799 +        
800 +
801          logfile << "Writing config file";
802          writeInstalledMods(installedMods);
803          setProgressBar(1000);
804 <        setStatusArea("Done! You can now play Oni.");
804 >        
805 >        string finallyDone = "Done! You can now play Oni.";
806 >        
807 >
808 >        
809 >        setStatusArea(finallyDone);
810  
811          ptime end_time(second_clock::local_time());
812          time_period total_time (start_time, end_time);
# Line 676 | Line 815 | void recompileAll(vector<string> install
815          ofstream logfile2("Install.log", ios::app | ios::ate);
816          string outstring = (string)"\n\nGlobalization ended " + to_simple_string(end_time) + "\nThe process took ";// + (string)total_time.length();
817  
818 <        logfile2 << "\nGlobalization ended " << to_simple_string(end_time) << "\nThe process took " << total_time.length();
818 >        logfile2 << "\nInstallation ended " << to_simple_string(end_time) << "\nThe process took " << total_time.length();
819  
820          //logfile2.write(outstring.c_str(), outstring.length());
821          logfile2.close();
# Line 685 | Line 824 | void recompileAll(vector<string> install
824  
825          Sleep(1000);
826          setProgressBar(0);
827 +
828 +        }
829 +        catch(exception & ex) {
830 +                remove("Install.log"); //why did we do this? :|
831 +                ofstream logfile("Install.log");
832 +
833 +
834 +                logfile << "Warning, exception " << ex.what() << "!";
835 +                setStatusArea("Warning, exception " + (string)ex.what() + "!");
836 +                logfile.close();        
837 +        }
838          busy = 0;
839   }
840  
841 + void copyBSL(string copypath, vector<string>& BSLfolders, ModPackage pkg) {
842 +
843 +        ofstream BSLlog("BSL2.log", ios::app );
844 +        
845 +        try {
846 +                for ( directory_iterator dir_itr( copypath ), end_itr;
847 +                        dir_itr != end_itr;
848 +                        ++dir_itr ) {
849 +
850 +                                if ( is_directory( dir_itr->path() ) && dir_itr->path().string() != ".svn" ) {  
851 +                                        BSLlog << "Testing " << dir_itr->path().string() << " HasBSL: " << pkg.hasBSL << " HasAddon: " << pkg.hasAddon << "\n";
852 +                                        int skip_folder = 0;
853 +
854 +                                        for(unsigned int k = 0; k < BSLfolders.size(); k++)             {//iterate through already found BSL folders    
855 +                                                BSLlog << "testing " << dir_itr->path().filename() << " vs " << BSLfolders[k] << "\n";
856 +                                                if(dir_itr->path().filename() == BSLfolders[k]) {
857 +                                                        skip_folder = 1;
858 +                                                        BSLlog << "skipping " << BSLfolders[k] << " in " << pkg.modStringName << "\n";
859 +                                                        break;
860 +                                                }
861 +                                        }
862 +                                        if (!skip_folder && !exists("../GameDataFolder/IGMD/" + dir_itr->path().filename() + "/ignore.txt")) {
863 +                                                remove_all( "../GameDataFolder/IGMD/" + dir_itr->path().filename() );
864 +                                                Sleep(100);
865 +                                                create_directory( "../GameDataFolder/IGMD/" + dir_itr->path().filename());
866 +                                                BSLlog << "Copied " << dir_itr->path().string() << " in " << pkg.modStringName << "!\n";
867 +                                                for ( directory_iterator bsl_itr( dir_itr->path() );
868 +                                                        bsl_itr != end_itr;
869 +                                                        bsl_itr++ ) {
870 +                                                                if ( bsl_itr->path().extension() == ".bsl" ) {
871 +                                                                        copy_file(bsl_itr->path(),  "../GameDataFolder/IGMD/" + dir_itr->path().filename() + "/" + bsl_itr->path().filename());
872 +                                                                }
873 +                                                }
874 +                                                BSLfolders.push_back( dir_itr->path().filename() ); //add back check for addon
875 +                                                BSLlog << "Pushing " << dir_itr->path().filename() << "\n" ;
876 +                                        }
877 +                                }
878 +                }
879 +        }
880 +        catch ( const std::exception & ex )
881 +        {
882 +                setStatusArea("Warning, exception " + (string)ex.what() + "!");
883 +                while(1) Sleep(1000);
884 +        }
885 +        BSLlog.close();
886 +        
887 + }
888 +
889 +
890   void writeInstalledMods(vector<string> installedMods)
891   {
892  
# Line 769 | Line 968 | void clearOldDats(void) {
968  
969   }
970  
772 vector<string> globalInstalledMods;
773 vector<ModPackage> globalPackages;
971   #include "boost/thread.hpp"
972   #include <boost/thread/mutex.hpp>
973  
# Line 797 | Line 994 | vector<ModPackage> globalPackages;
994   #endif
995  
996   ////@begin includes
997 < #include "about_window.h"
997 > #include "about.h"
998   ////@end includes
999  
1000   #include "main_window.h"
1001  
1002   ////@begin XPM images
1003 < #include "redo.xpm"
1003 > #include "aelogosmall.xpm"
1004 > #include "undo.xpm"
1005   #include "fileopen.xpm"
1006   #include "filesaveas.xpm"
1007   #include "quit.xpm"
# Line 826 | Line 1024 | IMPLEMENT_CLASS( MainWindow, wxFrame )
1024   BEGIN_EVENT_TABLE( MainWindow, wxFrame )
1025  
1026   ////@begin MainWindow event table entries
1027 < EVT_CHECKBOX( SelectAll_Checkbox, MainWindow::OnSelectAllCheckboxClick )
1027 >    EVT_CHECKBOX( SelectAll_Checkbox, MainWindow::OnSelectAllCheckboxClick )
1028  
1029 < EVT_BUTTON( Refresh_Button, MainWindow::OnRefreshButtonClick )
1029 >    EVT_BUTTON( Refresh_Button, MainWindow::OnRefreshButtonClick )
1030  
1031 < EVT_LISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Selected )
1032 < EVT_CHECKLISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Toggled )
1031 >    EVT_LISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Selected )
1032 >    EVT_CHECKLISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Toggled )
1033  
1034 < EVT_UPDATE_UI( ID_STATUSBAR, MainWindow::OnStatusbarUpdate )
1034 >    EVT_UPDATE_UI( ID_STATUSBAR, MainWindow::OnStatusbarUpdate )
1035  
1036 < EVT_BUTTON( Install_Button, MainWindow::OnInstallButtonClick )
1036 >    EVT_BUTTON( Install_Button, MainWindow::OnInstallButtonClick )
1037  
1038 < EVT_RADIOBUTTON( Sep_RadioButton, MainWindow::OnSepRadioButtonSelected )
1038 >    EVT_RADIOBUTTON( Sep_RadioButton, MainWindow::OnSepRadioButtonSelected )
1039  
1040 < EVT_RADIOBUTTON( NoSep_RadioButton, MainWindow::OnNoSepRadioButtonSelected )
1040 >    EVT_RADIOBUTTON( NoSep_RadioButton, MainWindow::OnNoSepRadioButtonSelected )
1041  
1042 < EVT_RADIOBUTTON( Separated_RadioButton, MainWindow::OnSeparatedRadioButtonSelected )
1042 >    EVT_RADIOBUTTON( Seperated_RadioButton, MainWindow::OnSeperatedRadioButtonSelected )
1043  
1044 < EVT_RADIOBUTTON( Complete_RadioButton, MainWindow::OnCompleteRadioButtonSelected )
1044 >    EVT_RADIOBUTTON( Complete_RadioButton, MainWindow::OnCompleteRadioButtonSelected )
1045  
1046 < EVT_BUTTON( ReGlobalize_Button, MainWindow::OnReGlobalizeButtonClick )
1046 >    EVT_BUTTON( ReGlobalize_Button, MainWindow::OnReGlobalizeButtonClick )
1047  
1048 < EVT_MENU( wxID_LOAD, MainWindow::OnLoadClick )
1048 >    EVT_MENU( wxID_LOAD, MainWindow::OnLoadClick )
1049  
1050 < EVT_MENU( wxID_SAVE, MainWindow::OnSaveClick )
1050 >    EVT_MENU( wxID_SAVE, MainWindow::OnSaveClick )
1051  
1052 < EVT_MENU( wxID_EXIT, MainWindow::OnExitClick )
1052 >    EVT_MENU( wxID_EXIT, MainWindow::OnExitClick )
1053  
1054 < EVT_MENU( wxID_OPTIONS, MainWindow::OnOptionsClick )
1054 >    EVT_MENU( wxID_OPTIONS, MainWindow::OnOptionsClick )
1055  
1056 < EVT_MENU( wxID_ABOUT, MainWindow::OnAboutClick )
1056 >    EVT_MENU( wxID_ABOUT, MainWindow::OnAboutClick )
1057  
1058   ////@end MainWindow event table entries
1059  
# Line 885 | Line 1083 | MainWindow::MainWindow( wxWindow* parent
1083   bool MainWindow::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
1084   {
1085          ////@begin MainWindow creation
1086 <        wxFrame::Create( parent, id, caption, pos, size, style );
889 <
890 <        CreateControls();
891 <        SetIcon(GetIconResource(wxT("oni_special.ico")));
892 <        Centre();
893 <
1086 >    wxFrame::Create( parent, id, caption, pos, size, style );
1087  
1088 +    CreateControls();
1089 +    SetIcon(GetIconResource(wxT("aelogosmall.png")));
1090 +    Centre();
1091          ////@end MainWindow creation
1092          return true;
1093   }
# Line 915 | Line 1111 | MainWindow::~MainWindow()
1111   void MainWindow::Init()
1112   {
1113          ////@begin MainWindow member initialisation
1114 <        MainSplitter = NULL;
1115 <        SelectAll = NULL;
1116 <        RefreshButton = NULL;
1117 <        Mods_CheckboxList = NULL;
1118 <        titleText = NULL;
1119 <        creatorText = NULL;
1120 <        descriptionText = NULL;
1121 <        StatusArea = NULL;
1122 <        ProgressBar = NULL;
1123 <        InstallButton = NULL;
1124 <        OptionsPanel = NULL;
1125 <        SepRadio = NULL;
1126 <        NoSepRadio = NULL;
1127 <        SeparatedRadio = NULL;
1128 <        CompleteRadio = NULL;
1129 <        ReglobalizeButton = NULL;
1114 >    MainSplitter = NULL;
1115 >    SelectAll = NULL;
1116 >    RefreshButton = NULL;
1117 >    Mods_CheckboxList = NULL;
1118 >    titleText = NULL;
1119 >    creatorText = NULL;
1120 >    descriptionText = NULL;
1121 >    StatusArea = NULL;
1122 >    ProgressBar = NULL;
1123 >    InstallButton = NULL;
1124 >    OptionsPanel = NULL;
1125 >    SepRadio = NULL;
1126 >    NoSepRadio = NULL;
1127 >    SeperatedRadio = NULL;
1128 >    CompleteRadio = NULL;
1129 >    ReglobalizeButton = NULL;
1130          ////@end MainWindow member initialisation
1131  
1132   }
# Line 945 | Line 1141 | wxGauge* TheProgressBar;
1141   void MainWindow::CreateControls()
1142   {    
1143          ////@begin MainWindow content construction
1144 <        // Generated by DialogBlocks, 31/05/2009 19:03:55 (unregistered)
1144 >    MainWindow* itemFrame1 = this;
1145  
1146 <        MainWindow* itemFrame1 = this;
1147 <
1148 <        wxMenuBar* menuBar = new wxMenuBar;
1149 <        wxMenu* itemMenu37 = new wxMenu;
1150 <        {
1151 <                wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_LOAD, _("&Load Configuration..."), wxEmptyString, wxITEM_NORMAL);
1152 <                wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("fileopen.xpm")));
1153 <                menuItem->SetBitmap(bitmap);
1154 <                itemMenu37->Append(menuItem);
1155 <        }
1156 <        {
1157 <                wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_SAVE, _("&Save Configuration..."), wxEmptyString, wxITEM_NORMAL);
1158 <                wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("filesaveas.xpm")));
1159 <                menuItem->SetBitmap(bitmap);
1160 <                itemMenu37->Append(menuItem);
1161 <        }
1162 <        itemMenu37->AppendSeparator();
1163 <        {
1164 <                wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_EXIT, _("Exit"), wxEmptyString, wxITEM_NORMAL);
1165 <                wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("quit.xpm")));
1166 <                menuItem->SetBitmap(bitmap);
1167 <                itemMenu37->Append(menuItem);
1168 <        }
1169 <        menuBar->Append(itemMenu37, _("&File"));
1170 <        wxMenu* itemMenu42 = new wxMenu;
1171 <        itemMenu42->Append(wxID_OPTIONS, _("Show Advanced Options..."), wxEmptyString, wxITEM_CHECK);
1172 <        menuBar->Append(itemMenu42, _("Options"));
977 <        wxMenu* itemMenu44 = new wxMenu;
978 <        itemMenu44->Append(wxID_HELP, _("Help"), wxEmptyString, wxITEM_NORMAL);
1146 >    wxMenuBar* menuBar = new wxMenuBar;
1147 >    wxMenu* itemMenu37 = new wxMenu;
1148 >    {
1149 >        wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_LOAD, _("&Load Configuration..."), wxEmptyString, wxITEM_NORMAL);
1150 >        wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("fileopen.xpm")));
1151 >        menuItem->SetBitmap(bitmap);
1152 >        itemMenu37->Append(menuItem);
1153 >    }
1154 >    {
1155 >        wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_SAVE, _("&Save Configuration..."), wxEmptyString, wxITEM_NORMAL);
1156 >        wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("filesaveas.xpm")));
1157 >        menuItem->SetBitmap(bitmap);
1158 >        itemMenu37->Append(menuItem);
1159 >    }
1160 >    itemMenu37->AppendSeparator();
1161 >    {
1162 >        wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_EXIT, _("Exit"), wxEmptyString, wxITEM_NORMAL);
1163 >        wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("quit.xpm")));
1164 >        menuItem->SetBitmap(bitmap);
1165 >        itemMenu37->Append(menuItem);
1166 >    }
1167 >    menuBar->Append(itemMenu37, _("&File"));
1168 >    wxMenu* itemMenu42 = new wxMenu;
1169 >    itemMenu42->Append(wxID_OPTIONS, _("Show Advanced Options..."), wxEmptyString, wxITEM_CHECK);
1170 >    menuBar->Append(itemMenu42, _("Options"));
1171 >    wxMenu* itemMenu44 = new wxMenu;
1172 > #ifdef WIN32
1173          itemMenu44->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
1174          menuBar->Append(itemMenu44, _("Help"));
1175 <        itemFrame1->SetMenuBar(menuBar);
1176 <        
1177 <        wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
1178 <        itemFrame1->SetSizer(itemBoxSizer2);
1175 > #else
1176 >        itemMenu37->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
1177 > #endif  
1178 >
1179 >    itemFrame1->SetMenuBar(menuBar);
1180  
1181 <        MainSplitter = new wxSplitterWindow( itemFrame1, ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(100, 100), wxSP_LIVE_UPDATE|wxNO_BORDER );
1182 <        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);
1181 >    wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
1182 >    itemFrame1->SetSizer(itemBoxSizer2);
1183  
1184 <        // Connect events and objects
1185 <        Mods_CheckboxList->Connect(Mods_CheckboxList1, wxEVT_CREATE, wxWindowCreateEventHandler(MainWindow::ModList_OnCreate), NULL, this);
1184 >    MainSplitter = new wxSplitterWindow( itemFrame1, ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(100, 100), wxSP_LIVE_UPDATE|wxNO_BORDER );
1185 >    MainSplitter->SetMinimumPaneSize(1);
1186 >    MainSplitter->SetName(_T("MainSplitter"));
1187 >
1188 >    wxPanel* itemPanel4 = new wxPanel( MainSplitter, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1189 >    wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
1190 >    itemPanel4->SetSizer(itemBoxSizer5);
1191 >
1192 >    wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
1193 >    itemBoxSizer5->Add(itemBoxSizer6, 0, wxGROW|wxALL, 0);
1194 >    SelectAll = new wxCheckBox( itemPanel4, SelectAll_Checkbox, _("Select All/None"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE );
1195 >    SelectAll->SetValue(false);
1196 >    SelectAll->SetName(_T("SelectAll_Checkbox"));
1197 >    itemBoxSizer6->Add(SelectAll, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1198 >
1199 >    RefreshButton = new wxBitmapButton( itemPanel4, Refresh_Button, itemFrame1->GetBitmapResource(wxT("undo.xpm")), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
1200 >    RefreshButton->SetName(_T("RefreshButton"));
1201 >    itemBoxSizer6->Add(RefreshButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
1202 >
1203 >    wxArrayString Mods_CheckboxListStrings;
1204 >    Mods_CheckboxList = new wxCheckListBox( itemPanel4, Mods_CheckboxList1, wxDefaultPosition, wxDefaultSize, Mods_CheckboxListStrings, wxLB_HSCROLL );
1205 >    Mods_CheckboxList->SetName(_T("Mods_CheckboxList"));
1206 >    itemBoxSizer5->Add(Mods_CheckboxList, 1, wxGROW|wxALL, 0);
1207 >
1208 >    wxPanel* itemPanel10 = new wxPanel( MainSplitter, DescriptionHolder_Panel, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1209 >    itemPanel10->SetName(_T("DescriptionHolder_Panel"));
1210 >    wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL);
1211 >    itemPanel10->SetSizer(itemBoxSizer11);
1212 >
1213 >    wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
1214 >    itemBoxSizer11->Add(itemBoxSizer12, 0, wxGROW|wxALL, 0);
1215 >    wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL);
1216 >    itemBoxSizer12->Add(itemBoxSizer13, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0);
1217 >    titleText = new wxTextCtrl( itemPanel10, Title_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
1218 >    titleText->SetName(_T("Title_Text"));
1219 >    titleText->SetBackgroundColour(wxColour(240, 240, 240));
1220 >    itemBoxSizer13->Add(titleText, 1, wxGROW|wxLEFT, 5);
1221 >
1222 >    wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxVERTICAL);
1223 >    itemBoxSizer12->Add(itemBoxSizer15, 1, wxGROW|wxALL, 0);
1224 >    creatorText = new wxTextCtrl( itemPanel10, Author_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_RIGHT );
1225 >    creatorText->SetName(_T("Author_Text"));
1226 >    creatorText->SetBackgroundColour(wxColour(240, 240, 240));
1227 >    itemBoxSizer15->Add(creatorText, 1, wxGROW|wxRIGHT, 5);
1228 >
1229 >    wxStaticLine* itemStaticLine17 = new wxStaticLine( itemPanel10, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
1230 >    itemStaticLine17->Show(false);
1231 >    itemBoxSizer11->Add(itemStaticLine17, 0, wxGROW|wxALL, 5);
1232 >
1233 >    descriptionText = new wxTextCtrl( itemPanel10, Description_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH|wxTE_RICH2 );
1234 >    descriptionText->SetName(_T("DescriptionName"));
1235 >    descriptionText->SetBackgroundColour(wxColour(240, 240, 240));
1236 >    itemBoxSizer11->Add(descriptionText, 1, wxGROW|wxLEFT|wxRIGHT, 5);
1237 >
1238 >    MainSplitter->SplitVertically(itemPanel4, itemPanel10, 200);
1239 >    itemBoxSizer2->Add(MainSplitter, 1, wxGROW|wxALL, 0);
1240 >
1241 >    StatusArea = new wxStatusBar( itemFrame1, ID_STATUSBAR, 0 );
1242 >    StatusArea->SetName(_T("StatusArea"));
1243 >    StatusArea->SetFieldsCount(1);
1244 >    StatusArea->SetStatusText(_("AE Installer v1.0.1"), 0);
1245 >    itemBoxSizer2->Add(StatusArea, 0, wxGROW|wxALL, 0);
1246 >
1247 >    wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL);
1248 >    itemBoxSizer2->Add(itemBoxSizer20, 0, wxGROW|wxALL, 0);
1249 >
1250 >    ProgressBar = new wxGauge( itemFrame1, ProgressBar_Gauge, 1000, wxDefaultPosition, wxDefaultSize, wxGA_SMOOTH );
1251 >    ProgressBar->SetValue(0);
1252 >    itemBoxSizer20->Add(ProgressBar, 1, wxGROW|wxALL, 0);
1253 >
1254 >    InstallButton = new wxButton( itemFrame1, Install_Button, _("Install!"), wxDefaultPosition, wxDefaultSize, 0 );
1255 >    itemBoxSizer20->Add(InstallButton, 0, wxGROW|wxALL, 0);
1256 >
1257 >    wxBoxSizer* itemBoxSizer23 = new wxBoxSizer(wxVERTICAL);
1258 >    itemBoxSizer2->Add(itemBoxSizer23, 0, wxGROW|wxALL, 0);
1259 >
1260 >    OptionsPanel = new wxPanel( itemFrame1, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1261 >    itemBoxSizer2->Add(OptionsPanel, 0, wxGROW, 0);
1262 >
1263 >    wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxHORIZONTAL);
1264 >    OptionsPanel->SetSizer(itemBoxSizer25);
1265 >
1266 >    wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxVERTICAL);
1267 >    itemBoxSizer25->Add(itemBoxSizer26, 0, wxGROW|wxALL, 5);
1268 >
1269 >    SepRadio = new wxRadioButton( OptionsPanel, Sep_RadioButton, _("Sep"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1270 >    SepRadio->SetValue(false);
1271 >    if (MainWindow::ShowToolTips())
1272 >        SepRadio->SetToolTip(_("For PC Demo and Mac"));
1273 >    itemBoxSizer26->Add(SepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1274 >
1275 >    NoSepRadio = new wxRadioButton( OptionsPanel, NoSep_RadioButton, _("NoSep"), wxDefaultPosition, wxDefaultSize, 0 );
1276 >    NoSepRadio->SetValue(false);
1277 >    if (MainWindow::ShowToolTips())
1278 >        NoSepRadio->SetToolTip(_("For PC Retail"));
1279 >    itemBoxSizer26->Add(NoSepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1280 >
1281 >    wxStaticLine* itemStaticLine29 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1282 >    itemBoxSizer25->Add(itemStaticLine29, 0, wxGROW|wxALL, 5);
1283 >
1284 >    wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxVERTICAL);
1285 >    itemBoxSizer25->Add(itemBoxSizer30, 0, wxGROW|wxALL, 5);
1286 >
1287 >    SeperatedRadio = new wxRadioButton( OptionsPanel, Seperated_RadioButton, _("Separated Level0"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1288 >    SeperatedRadio->SetValue(false);
1289 >    SeperatedRadio->SetName(_T("Seperated_RadioButton"));
1290 >    itemBoxSizer30->Add(SeperatedRadio, 0, wxALIGN_LEFT|wxALL, 5);
1291 >
1292 >    CompleteRadio = new wxRadioButton( OptionsPanel, Complete_RadioButton, _("Complete Level0"), wxDefaultPosition, wxDefaultSize, 0 );
1293 >    CompleteRadio->SetValue(false);
1294 >    CompleteRadio->SetName(_T("Complete_RadioButton"));
1295 >    itemBoxSizer30->Add(CompleteRadio, 0, wxALIGN_LEFT|wxALL, 5);
1296 >
1297 >    wxStaticLine* itemStaticLine33 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1298 >    itemBoxSizer25->Add(itemStaticLine33, 0, wxGROW|wxALL, 5);
1299 >
1300 >    wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxVERTICAL);
1301 >    itemBoxSizer25->Add(itemBoxSizer34, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1302 >
1303 >    ReglobalizeButton = new wxButton( OptionsPanel, ReGlobalize_Button, _("Reglobalize"), wxDefaultPosition, wxDefaultSize, 0 );
1304 >    ReglobalizeButton->SetName(_T("Reglobalize_Button"));
1305 >    itemBoxSizer34->Add(ReglobalizeButton, 0, wxGROW|wxALL, 5);
1306 >
1307 >    // Connect events and objects
1308 >    Mods_CheckboxList->Connect(Mods_CheckboxList1, wxEVT_CREATE, wxWindowCreateEventHandler(MainWindow::ModList_OnCreate), NULL, this);
1309          ////@end MainWindow content construction
1310 + #ifdef WIN32
1311 +        Handle = (HWND)GetHWND();
1312 +        ::CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_ITaskbarList, (void **)&pTaskbarList);
1313 + #endif
1314  
1315 <        if ( exists( "../../GameDataFolder/level0_Final.sep" ) ) {
1316 <                static_cast<string>("-import:sep");
1315 >
1316 >        /*if ( exists( "../../GameDataFolder/level0_Final.sep" ) ) {
1317 >                strImportOption = "-import:sep";
1318                  splitInstances = NOT_SPLIT;
1319          }
1320          else {
1321 <                static_cast<string>("-import:nosep");
1321 >                strImportOption = "-import:nosep";
1322                  splitInstances = SPLIT;
1323 <        }
1323 >        }*/
1324 >        
1325  
1326 + #ifndef WIN32
1327 +                strImportOption = "-import:sep";
1328 +                splitInstances = NOT_SPLIT;
1329 + #else
1330 +                strImportOption = "-import:nosep";
1331 +                splitInstances = SPLIT;
1332 + #endif
1333 +
1334 + #ifndef WIN32
1335 +        strImportOption = "-import:sep";
1336 +        splitInstances = NOT_SPLIT;
1337 + #else
1338 +        strImportOption = "-import:nosep";
1339 +        splitInstances = SPLIT;
1340 + #endif
1341 +        
1342          globalPackages = getPackages();
1343          globalInstalledMods = getInstallString();
1344 <        for (int i = 0; i < globalPackages.size(); i++) {
1344 >        for (unsigned int i = 0; i < globalPackages.size(); i++) {
1345                  Mods_CheckboxList->Append(globalPackages[i].name.c_str());
1346                  if( binary_search(globalInstalledMods.begin(), globalInstalledMods.end(), globalPackages[i].modStringName ) ) Mods_CheckboxList->Check(i);
1347          }
# Line 1130 | Line 1350 | void MainWindow::CreateControls()
1350          TheInstallButton = InstallButton;
1351          TheProgressBar = ProgressBar;
1352          OptionsPanel->Hide();
1353 <        if(splitInstances == SPLIT) SeparatedRadio->SetValue(true);
1353 >        
1354 > //#ifndef WIN32
1355 > //      itemMenu37->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
1356 >        
1357 > //#endif
1358 >        
1359 >        if(splitInstances == SPLIT) SeperatedRadio->SetValue(true);
1360          else CompleteRadio->SetValue(true);
1135
1136
1137
1361          if(strImportOption == "-import:nosep") NoSepRadio->SetValue(true);
1362          else SepRadio->SetValue(true);
1363  
# Line 1157 | Line 1380 | void MainWindow::OnSelectAllCheckboxClic
1380   {
1381          switch(SelectAll->Get3StateValue()) {
1382          case wxCHK_UNCHECKED:
1383 <                for(int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, false);
1383 >                for(unsigned int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, false);
1384                  //SelectAll->Set3StateValue(wxCHK_CHECKED);
1385                  break;
1386          case wxCHK_CHECKED:
1387 <                for(int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, true);
1387 >                for(unsigned int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, true);
1388                  //SelectAll->Set3StateValue(wxCHK_UNCHECKED);
1389                  break;
1390          case wxCHK_UNDETERMINED:
1391 <                for(int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, false);
1391 >                for(unsigned int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, false);
1392                  //SelectAll->Set3StateValue(wxCHK_CHECKED);
1393                  break;
1394  
# Line 1202 | Line 1425 | wxBitmap MainWindow::GetBitmapResource(
1425   {
1426          // Bitmap retrieval
1427          ////@begin MainWindow bitmap retrieval
1428 <        wxUnusedVar(name);
1429 <        if (name == _T("redo.xpm"))
1430 <        {
1431 <                wxBitmap bitmap(redo_xpm);
1432 <                return bitmap;
1433 <        }
1434 <        else if (name == _T("fileopen.xpm"))
1435 <        {
1436 <                wxBitmap bitmap( fileopen_xpm);
1437 <                return bitmap;
1438 <        }
1439 <        else if (name == _T("filesaveas.xpm"))
1440 <        {
1441 <                wxBitmap bitmap( filesaveas_xpm);
1442 <                return bitmap;
1443 <        }
1444 <        else if (name == _T("quit.xpm"))
1445 <        {
1446 <                wxBitmap bitmap( quit_xpm);
1447 <                return bitmap;
1448 <        }
1449 <        return wxNullBitmap;
1428 >    wxUnusedVar(name);
1429 >    if (name == _T("undo.xpm"))
1430 >    {
1431 >        wxBitmap bitmap( undo_xpm);
1432 >        return bitmap;
1433 >    }
1434 >    else if (name == _T("fileopen.xpm"))
1435 >    {
1436 >        wxBitmap bitmap( fileopen_xpm);
1437 >        return bitmap;
1438 >    }
1439 >    else if (name == _T("filesaveas.xpm"))
1440 >    {
1441 >        wxBitmap bitmap( filesaveas_xpm);
1442 >        return bitmap;
1443 >    }
1444 >    else if (name == _T("quit.xpm"))
1445 >    {
1446 >        wxBitmap bitmap( quit_xpm);
1447 >        return bitmap;
1448 >    }
1449 >    return wxNullBitmap;
1450          ////@end MainWindow bitmap retrieval
1451   }
1452  
# Line 1236 | Line 1459 | wxIcon MainWindow::GetIconResource( cons
1459  
1460          // Icon retrieval
1461          ////@begin MainWindow icon retrieval
1462 <        wxUnusedVar(name);
1463 <        if (name == _T("oni_special.ico"))
1464 <        {
1465 <                //      wxIcon icon(_T("oni_special.ico"), wxBITMAP_TYPE_ICO);
1466 <                //      return icon;
1467 <        }
1468 <        return wxNullIcon;
1462 >    wxUnusedVar(name);
1463 >    if (name == _T("aelogosmall.png"))
1464 >    {
1465 >        wxIcon icon(aelogosmall_xpm);
1466 >        return icon;
1467 >    }
1468 >    return wxNullIcon;
1469          ////@end MainWindow icon retrieval
1470   }
1471  
# Line 1292 | Line 1515 | void MainWindow::OnOptionsClick( wxComma
1515   {
1516          if (!event.GetInt() ) {
1517                  OptionsPanel->Hide();
1518 +                
1519                  this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight());}
1520          else {
1521   //              Uncomment this when we release, it gets annoying if you are testing globalization a lot ;)
# Line 1328 | Line 1552 | struct recompile
1552                  TheInstallButton->Disable();
1553                  recompileAll(thePackages);
1554                  TheInstallButton->Enable();
1555 +                
1556          }
1557  
1558          vector<string> thePackages;
1559   };
1560  
1561 + void globalize2(void) {
1562 +                TheInstallButton->Disable();
1563 +                globalizeData();
1564 +                TheInstallButton->Enable();
1565 + }
1566 +
1567 +
1568 +
1569   void MainWindow::OnInstallButtonClick( wxCommandEvent& event )
1570   {
1571  
1572          vector<string> localPackages;
1573 <        localPackages.push_back("Globalize");
1574 <        for(int i = 0; i < globalPackages.size(); i++) if(Mods_CheckboxList->IsChecked(i)) localPackages.push_back( globalPackages[i].modStringName );
1573 >        localPackages.push_back("00000Globalize");
1574 >        for(unsigned int i = 0; i < globalPackages.size(); i++) if(Mods_CheckboxList->IsChecked(i)) localPackages.push_back( globalPackages[i].modStringName );
1575          if ( !localPackages.empty() )   {
1576 <        
1576 >                sort(localPackages.begin(), localPackages.end());
1577 >                localPackages[0] = "Globalize";
1578                  //MainWindow::MainWindow().Hide();      
1579                  //      boost::thread thrd2(recompileAll(localPackages) );
1580                  //MainWindow::MainWindow().Show();
# Line 1374 | Line 1608 | void MainWindow::OnInstallButtonClick( w
1608  
1609   void setProgressBar( int i ) {
1610          //TheProgressBar->SetValue(
1611 + #ifdef WIN32
1612 +        
1613  
1614 +
1615 + if (SUCCEEDED(pTaskbarList->QueryInterface(IID_ITaskbarList3, (void **)&pTaskbarList3)))
1616 + {
1617 +        
1618 +        pTaskbarList3->SetProgressValue(Handle,i, 1000);
1619 +        if ( i == 0 ) {
1620 +
1621 +        pTaskbarList3->SetProgressState(Handle,TBPF_NOPROGRESS);
1622 +        }
1623 + }
1624 +
1625 +
1626 + #endif
1627          TheProgressBar->SetValue(i);
1628  
1629   }
# Line 1387 | Line 1636 | void setProgressBar( int i ) {
1636   void MainWindow::OnStatusbarUpdate( wxUpdateUIEvent& event )
1637   {
1638          ////@begin wxEVT_UPDATE_UI event handler for ID_STATUSBAR in MainWindow.
1639 <        // Before editing this code, remove the block markers.
1640 <        event.Skip();
1639 >    // Before editing this code, remove the block markers.
1640 >    event.Skip();
1641          ////@end wxEVT_UPDATE_UI event handler for ID_STATUSBAR in MainWindow.
1642   }
1643  
# Line 1400 | Line 1649 | void MainWindow::OnStatusbarUpdate( wxUp
1649   void MainWindow::OnAboutClick( wxCommandEvent& event )
1650   {
1651          ////@begin wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow.
1652 <        // Before editing this code, remove the block markers.
1653 <        About* window = new About(this);
1654 <        int returnValue = window->ShowModal();
1655 <        window->Destroy();
1652 >    // Before editing this code, remove the block markers.
1653 >    About* window = new About(this);
1654 >    int returnValue = window->ShowModal();
1655 >    window->Destroy();
1656          ////@end wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow.
1657   }
1658  
# Line 1432 | Line 1681 | void MainWindow::OnSepRadioButtonSelecte
1681   * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton
1682   */
1683  
1435 void MainWindow::OnSeparatedRadioButtonSelected( wxCommandEvent& event )
1436 {
1437        splitInstances = SPLIT;
1438
1439 }
1440
1441
1684   /*
1685   * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Complete_RadioButton
1686   */
# Line 1471 | Line 1713 | void MainWindow::refreshMods (vector<str
1713  
1714          Mods_CheckboxList->Clear();
1715          //globalInstalledMods = getPackages();
1716 <        for (int i = 0; i < globalPackages.size(); i++) {
1716 >        for (unsigned int i = 0; i < globalPackages.size(); i++) {
1717                  Mods_CheckboxList->Append(globalPackages[i].name.c_str());
1718                  if( binary_search(s.begin(), s.end(), globalPackages[i].modStringName ) ) Mods_CheckboxList->Check(i);
1719                  //else Mods_CheckboxList->Check(i,0);
# Line 1534 | Line 1776 | void MainWindow::OnSaveClick( wxCommandE
1776                  ofstream file(openFileDialog->GetPath().c_str());
1777  
1778                  vector<string>list;
1779 <                for(int i = 0; i < globalPackages.size(); i++) if(Mods_CheckboxList->IsChecked(i)) list.push_back( globalPackages[i].modStringName );
1779 >                for(unsigned int i = 0; i < globalPackages.size(); i++) if(Mods_CheckboxList->IsChecked(i)) list.push_back( globalPackages[i].modStringName );
1780                  vector<string>::iterator begin_iter = list.begin();
1781                  vector<string>::iterator end_iter = list.end();
1782  
# Line 1600 | Line 1842 | event.Skip();
1842   ////@end wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton in MainWindow.
1843   }*/
1844  
1845 +
1846 + /*
1847 + * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Seperated_RadioButton
1848 + */
1849 +
1850 + void MainWindow::OnSeperatedRadioButtonSelected( wxCommandEvent& event )
1851 + {
1852 + splitInstances = SPLIT;
1853 + }
1854 +

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)