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 355 by gumby, Thu Jun 18 22:30:30 2009 UTC vs.
Revision 409 by iritscen, Tue Jul 7 12:48:37 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
14 > AE/Mod Installer
15 > by Gumby and Iritscen
16   */
17  
18 < // To-do: -
18 > // To-do: - Load credits from text resource file
19   //                - Institute lots of checks into file-handling
20 < //                - Clear mod info fields when mod is de-selected ???
20 > //                - Clear mod info fields when mod is de-selected
21  
22   #define DEBUG
23   #include <stdio.h>
# Line 30 | Line 42 | by Gumby and Iritscen
42   #include <dirent.h>
43   #endif
44  
45 < const string strInstallerVersion = "1.0";
45 > //const string strInstallerVersion = "1.0";
46   const bool SPLIT = 1;
47   const bool NOT_SPLIT = 0;
48   bool splitInstances = SPLIT;
49 <
49 > bool busy = 0;
50   #ifdef WIN32
51   const string strOniSplit = "Onisplit.exe";
52   string strImportOption = "-import:nosep";
# Line 58 | Line 70 | using namespace std;
70   #include "boost/date_time/date_parsing.hpp"
71   #include "boost/date_time/posix_time/posix_time.hpp"
72  
73 + string escapePath(string input) {
74 +        
75 +        string output;
76 +        string escape_me = "& ;()|<>\"'\\#*?$";
77 +        for(int i = 0; i < input.size(); i++)  {
78 +                for(int j = 0; j < escape_me.size(); j++) if (input[i] == escape_me[j]) output += '\\';
79 +                output += input[i];
80 +        }
81 +        return output;
82 + }
83 +
84   int globalizeData(void)
85   {
86 <            using boost::lexical_cast;
87 <    using boost::bad_lexical_cast;
88 < // using namespace boost::posix_time;
86 >        busy = 1;
87 >        using boost::lexical_cast;
88 >        using boost::bad_lexical_cast;
89 >        // using namespace boost::posix_time;
90          using namespace boost::gregorian;
91          using namespace boost::posix_time;
92          ptime start_time(second_clock::local_time());
# Line 76 | Line 100 | int globalizeData(void)
100          ofstream logfile("Globalize.log");
101          logfile << "Globalization started " << to_simple_string(start_time) << endl;
102          try {
103 <                
103 >
104                  char levels_cstr[15][3] = {"0", "1", "2", "3", "4", "6", "8", "9", "10", "11", "12", "13", "14", "18", "19"}; // the levels Oni has...probably should have made a string array. Oops.
105                  //const vector<double> ck(cv, &cv[CvSize]);
106                  vector<string> levels;
# Line 95 | Line 119 | int globalizeData(void)
119                  path Animations = "../GameDataFolder/level0_Animations";
120                  path TRAC = Animations / "level0_TRAC";
121                  path TRAM = Animations / "level0_TRAM";
122 <                
122 >
123                  vector<path> GDFPaths;
124                  GDFPaths.push_back(Characters);
125                  GDFPaths.push_back(Particles);
# Line 103 | Line 127 | int globalizeData(void)
127                  GDFPaths.push_back(Sounds);
128                  GDFPaths.push_back(TRAC);
129                  GDFPaths.push_back(TRAM);
130 <                
131 <                        
132 <                path VanillaCharacters = "packages/VanillaDats/level0_Final/level0_Characters/level0_Characters.oni";
133 <                path VanillaParticles = "packages/VanillaDats/level0_Final/level0_Particles/level0_Particles.oni";
134 <                path VanillaTextures  = "packages/VanillaDats/level0_Final/level0_Textures/level0_Textures.oni";
135 <                path VanillaSounds = "packages/VanillaDats/level0_Final/level0_Sounds/level0_Sounds.oni";
136 <                path VanillaAnimations = "packages/VanillaDats/level0_Final/level0_Animations/level0_Animations.oni";
137 <                path VanillaTRAC = "packages/VanillaDats/level0_Final/level0_Animations/level0_TRAC.oni";
138 <                path VanillaTRAM = "packages/VanillaDats/level0_Final/level0_Animations/level0_TRAM.oni";
130 >
131 >
132 >                path VanillaCharacters = "VanillaDats/level0_Final/level0_Characters/level0_Characters.oni";
133 >                path VanillaParticles = "VanillaDats/level0_Final/level0_Particles/level0_Particles.oni";
134 >                path VanillaTextures  = "VanillaDats/level0_Final/level0_Textures/level0_Textures.oni";
135 >                path VanillaSounds = "VanillaDats/level0_Final/level0_Sounds/level0_Sounds.oni";
136 >                path VanillaAnimations = "VanillaDats/level0_Final/level0_Animations/level0_Animations.oni";
137 >                path VanillaTRAC = "VanillaDats/level0_Final/level0_Animations/level0_TRAC.oni";
138 >                path VanillaTRAM = "VanillaDats/level0_Final/level0_Animations/level0_TRAM.oni";
139  
140                  vector<path> VanillaPaths;
141 <                
141 >
142                  VanillaPaths.push_back(VanillaCharacters);
143                  VanillaPaths.push_back(VanillaParticles);
144                  VanillaPaths.push_back(VanillaTextures);
145                  VanillaPaths.push_back(VanillaSounds);
146                  VanillaPaths.push_back(VanillaTRAC);
147                  VanillaPaths.push_back(VanillaTRAM);
148 <                
148 >
149                  /*
150                  if (exists("../GameDataFolder/"))
151                  {
# Line 142 | Line 166 | int globalizeData(void)
166                  setStatusArea("Creating needed directories...");
167                  logfile <<  "Creating needed directories...\n";
168                  create_directory( "../GameDataFolder/" );
169 <                
169 >
170                  create_directory( "packages" );
171 <                
172 <                if (exists("packages/VanillaDats")) remove_all("packages/VanillaDats");
173 <                create_directory( "packages/VanillaDats" );
174 <                
151 <                create_directory( "packages/VanillaDats/level0_Final/" );
171 >
172 >                if (exists("VanillaDats")) remove_all("VanillaDats");
173 >                create_directory( "VanillaDats" );
174 >                create_directory( "VanillaDats/level0_Final/" );
175                  //blah blah finish this.
176 <                //logfile <<  "packages/VanillaDats/level0_Final/ created";
176 >                //logfile <<  "VanillaDats/level0_Final/ created";
177                  create_directory( Characters );
178                  create_directory( Particles );
179                  create_directory( Archive );
# Line 162 | Line 185 | int globalizeData(void)
185                  int num_levels = 0;
186                  for(int i = 1; i < 15; i++)
187                  {
188 <                                if (exists("../../GameDataFolder/level" + levels[i] + "_Final.dat")) {
188 >                        if (exists("../../GameDataFolder/level" + levels[i] + "_Final.dat")) {
189                                  num_levels++;
190  
191                          }
# Line 171 | Line 194 | int globalizeData(void)
194                  int total_steps =  8 + 2 * num_levels;
195                  for(int i = 0; i < 15; i++)
196                  {
197 <                        
197 >
198                          //printf(levels[i],"%d",levels[i]); // int to char array
199 <                        
199 >
200                          if (exists("../../GameDataFolder/level" + levels[i] + "_Final.dat")) {
201                                  logfile << "level" << levels[i] << "_Final\n";
202                                  logfile << "\tExporting level" << levels[i] << "_Final.dat\n";
203                                  //printf(Step_x_x,"Step %d/%d: exporting level%d_final.dat", parts_done + 1,, levels[i]); setStatusArea((string)Step_x_x);
204                                  setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + " exporting level" + levels[i]+"_Final.dat");
205                                  create_directory( "../GameDataFolder/level" + levels[i] + "_Final" );
206 < //                              setStatusArea(strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat");
206 >                                //                              setStatusArea(strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat");
207                                  system((strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat").c_str());
208 <                                create_directory( "packages/VanillaDats/level" + levels[i] + "_Final" );
209 <                                create_directory( "packages/VanillaDats/level" + levels[i] + "_Final/level" + levels[i] + "_Final" );
208 >                                create_directory( "VanillaDats/level" + levels[i] + "_Final" );
209 >                                create_directory( "VanillaDats/level" + levels[i] + "_Final/level" + levels[i] + "_Final" );
210  
211                                  directory_iterator end_iter;
212                                  for ( directory_iterator dir_itr( "../GameDataFolder/level" + levels[i] + "_Final" ); dir_itr != end_iter; ++dir_itr )
# Line 256 | Line 279 | int globalizeData(void)
279                                                  else if (dir_itr->path().filename().substr(0,4) == "AGDB"
280                                                          || dir_itr->path().filename().substr(0,4) == "TRCM") {
281                                                                  cout <<dir_itr->path().filename() << "\n";
282 <                                        
282 >
283                                                                  if(!exists( Archive / dir_itr->filename())) rename(dir_itr->path(), Archive / dir_itr->filename());
284                                                                  else remove(dir_itr->path());
285                                                  }
286 +                                                else if (dir_itr->path().filename().substr(0,4) == "ONWC") { //fix for buggy ONWC overriding
287 +                                                                cout <<dir_itr->path().filename() << "\n";
288 +
289 +                                                                if(!exists( "VanillaDats/level0_Final/level0_Final/" +  dir_itr->filename())) rename(dir_itr->path(), "VanillaDats/level0_Final/level0_Final/" +  dir_itr->filename());
290 +                                                                else remove(dir_itr->path());
291 +                                                }
292                                                  if (exists(dir_itr->path())) {
293  
294                                                  }
# Line 269 | Line 298 | int globalizeData(void)
298                                          }
299  
300  
301 <                                                
301 >
302                                  }
303                                  logfile << "\tCleaning up TXMPs...\n";
304                                  system( (strOniSplit + " -move:delete " + Textures.string() + " ../GameDataFolder/level" + levels[i] + "_Final/TXMP*.oni").c_str());
305                                  parts_done++;
306  
307                                  setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) ));
308 <                                
308 >
309                          }
310                  }
311                  logfile << "Reimporting levels\n";
# Line 286 | Line 315 | int globalizeData(void)
315                          //printf(levels[i],"%d",levels[i]);
316                          //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");
317                          setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + " reimporting level" + levels[i]+"_Final.oni");
318 <                        system( (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level"
319 <                                + levels[i] + "_Final/level" + levels[i] + "_Final.oni > Globalize.oni").c_str());
318 >                        logfile << (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final VanillaDats/level" + levels[i] + "_Final/level"
319 >                                + levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize.log").c_str() << '\n';
320 >                        string sys_str = (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final VanillaDats/level" + levels[i] + "_Final/level"
321 >                                + levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize.log");
322 >                                system(sys_str.c_str() );
323                          setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) ));
324 <                                parts_done++;
324 >                        parts_done++;
325                  }
326                  create_directory( VanillaCharacters.parent_path() );
327                  create_directory( VanillaParticles.parent_path() );
328                  create_directory( VanillaTextures.parent_path() );
329                  create_directory( VanillaSounds.parent_path() );
330                  create_directory( VanillaAnimations.remove_filename() );
331 <                
331 >
332                  for(int j = 0; j < GDFPaths.size(); j++) {
333                          logfile << "\tReimporting " << GDFPaths[j].filename() << ".oni\n";
334 <                        setStatusArea("Step" + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + ": reimporting " + GDFPaths[j].filename() );
334 >                        setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + ": reimporting " + GDFPaths[j].filename() );
335                          system((strOniSplit + " " + strImportOption + " " + GDFPaths[j].string() + " " + VanillaPaths[j].string()).c_str());
336                          parts_done++;
337                          setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) ));
338                  }
339 < /*
339 >                /*
340                  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) ));
341                  system((strOniSplit + " " + strImportOption + " " + Characters.string() + " " + VanillaCharacters.string()).c_str());
342                  parts_done++; printf(Step_x_x,"Step %d/%d: reimporting level0_Particles", parts_done,7 + 2 * num_levels); setStatusArea((string)Step_x_x);setProgressBar( (int)(1000 * (float)(parts_done) / (float)(7 + 2 * num_levels) ));
# Line 320 | Line 352 | int globalizeData(void)
352                  system((strOniSplit + " " + strImportOption + " " + TRAM.string() + " " + VanillaTRAM.string()).c_str());
353                  //parts_done++; setStatusArea((string)"Copying level scripts...");setProgressBar( (int)(1000 * (float)(parts_done) / (float)(7 + 2 * num_levels) ));
354                  if (exists("../GameDataFolder/IGMD")) remove_all("../GameDataFolder/IGMD");
355 < */
355 >                */
356                  create_directory((path)"../GameDataFolder/IGMD");
357 <                copy((path)"packages/VanillaBSL/", (path)"../GameDataFolder");
358 <                setProgressBar( 1000 );
359 <                setStatusArea((string)"Done! Now select your mod packages and click install.");
360 <        //      while(1) Sleep(-1);
357 >                copy((path)"packages/VanillaBSL/IGMD", (path)"../GameDataFolder");
358 >                setProgressBar( 1000 );
359 >
360 >                if(!exists("../persist.dat"))
361 >                        copy("../../persist.dat","..");
362 >                if(!exists("../key_config.txt"))
363 >                        copy("../../key_config.txt","..");
364 >                
365 > #ifndef WIN32
366 >                /* 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).
367 >                   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
368 >                   run Oni before :-p */
369 >                string fullAEpath = escapePath(system_complete(".").parent_path().parent_path().string()); // get full path for edition/
370 >                char prefsCommand[300] = "[ -f ~/Library/Preferences/com.godgames.oni.plist ] && defaults write com.godgames.oni RetailInstallationPath -string '";
371 >                strcat(prefsCommand, fullAEpath.c_str()); // get path of edition/ folder (Oni wants the folder that *contains* the GDF)
372 >                strcat(prefsCommand, "'"); // path string is enclosed in single quotes to avoid the need to escape UNIX-unfriendly characters
373 >                system(prefsCommand);
374 >                
375 > #endif
376 >                
377                  
378 +                setStatusArea((string)"Done! Now select your mod packages and click install.");
379 +                //      while(1) Sleep(-1);
380 +
381          }
382 <        catch (exception ex) {
382 >        catch (exception & ex) {
383                  setStatusArea("Warning, handled exception: " + (string)ex.what());
384          }
334        
335                ptime end_time(second_clock::local_time());
336                time_period total_time (start_time, end_time);
337                logfile << "\n\nGlobalization ended " << to_simple_string(end_time) << "\nThe process took " << total_time.length();
338                //total_time.length().hours();
339        logfile.close();
385  
386 +        ptime end_time(second_clock::local_time());
387 +        time_period total_time (start_time, end_time);
388 +        logfile << "\n\nGlobalization ended " << to_simple_string(end_time) << "\nThe process took " << total_time.length();
389 +        //total_time.length().hours();
390 +        logfile.close();
391 +        busy = 0;
392          return err;
393   }
394  
# Line 490 | Line 541 | ModPackage fileToModPackage(fstream &fil
541  
542   void recompileAll(vector<string> installedMods)
543   {
544 +        busy = 1;
545          using namespace boost::gregorian;
546          using namespace boost::posix_time;
547 +        using boost::lexical_cast;
548 +        using boost::bad_lexical_cast;
549          
550          setStatusArea("Importing levels...");
551          //setStatusArea("Recompiling Data...");
552 <        path vanilla_dir = "./packages/VanillaDats/";
552 >        path vanilla_dir = "./VanillaDats/";
553          string importCommand = "";
554          char statusString[128];
555          int numberOfDats = 0;
# Line 526 | Line 580 | void recompileAll(vector<string> install
580  
581                          }
582                  }
583 <
583 >                try {
584                  //recursive_directory_iterator end_iter;
585  
586  
587                  out << numberOfDats;
588                  datString = out.str();
535                try {
589                          for ( recursive_directory_iterator dir_itr( vanilla_dir );
590                                  dir_itr != end_iter;
591                                  ++dir_itr )
# Line 546 | Line 599 | void recompileAll(vector<string> install
599                                                          if (exists("packages/" + installedMods[i] + "/oni/" + dir_itr->path().parent_path().filename() + '/' + dir_itr->path().filename()  ))
600                                                                  importCommand += " packages/" + installedMods[i] + "/oni/" + dir_itr->path().parent_path().filename() + '/' + dir_itr->path().filename();
601  
602 <                                                        //else cout << " packages/VanillaDats/" + installedMods[i] + "/oni/";
602 >                                                        //else cout << " VanillaDats/" + installedMods[i] + "/oni/";
603                                                  }
604                                                  importCommand += " ../GameDataFolder/" + dir_itr->path().filename() + ".dat >> Install.log";
605  
606 <                                                printf(statusString,"%d/%i\0",j,numberOfDats);  
606 >                                                
607                                                  setProgressBar( (int)(1000 * (float)(j-1) / (float)numberOfDats) ); //100% * dat we're on / total dats
608 <                                                setStatusArea("Importing " +  dir_itr->path().filename() + " " + statusString);
608 >                                                setStatusArea("Step " + lexical_cast<std::string>(j) + '/' + lexical_cast<std::string>(numberOfDats)+ ": Importing " +  dir_itr->path().filename() + " ");
609  
610                                                  system(importCommand.c_str());
611                                                  //Sleep(1000);
# Line 563 | Line 616 | void recompileAll(vector<string> install
616                                  }
617                                  catch ( const std::exception & ex )
618                                  {
619 <                                        
620 <        remove("Install.log");
621 <        ofstream logfile("Install.log");
622 <        
623 <        
619 >
620 >                                        remove("Install.log");
621 >                                        ofstream logfile("Install.log");
622 >
623 >
624                                          logfile << "Warning, exception " << ex.what() << "!";
625                                          setStatusArea("Warning, exception " + (string)ex.what() + "!");
626 < logfile.close();        
626 >                                        logfile.close();        
627                                  }
628                          }
629  
630                  }
631                  catch( const std::exception & ex ) {
632 <        
633 <        remove("Install.log");
634 <        ofstream logfile("Install.log");
635 <        
636 <        
637 <                                        logfile << "Warning, exception " << ex.what() << "!";
638 <                                        setStatusArea("Warning, exception " + (string)ex.what() + "!");
639 < logfile.close();
632 >
633 >                        remove("Install.log");
634 >                        ofstream logfile("Install.log");
635 >
636 >
637 >                        logfile << "Warning, exception " << ex.what() << "!";
638 >                        setStatusArea("Warning, exception " + (string)ex.what() + "!");
639 >                        logfile.close();
640                  }
641  
642          }
# Line 614 | Line 667 | logfile.close();
667                          {
668                                  if ( is_directory( dir_itr->status() ) )
669                                  {
670 <                                        importCommand = strOniSplit + " " + strImportOption + " " + vanilla_dir.string() + dir_itr->path().filename() + " " + "../GameDataFolder/" + dir_itr->path().filename()
618 <                                                + ".dat";
670 >                                        importCommand = strOniSplit + " " + strImportOption + " " + vanilla_dir.string() + dir_itr->path().filename() + " ";
671                                          for (int i = 0; i < installedMods.size(); ++i) {
672                                                  if (exists("packages/" + installedMods[i] + "/oni/" + dir_itr->path().filename()  ))
673                                                          importCommand += " packages/" + installedMods[i] + "/oni/" + dir_itr->path().filename();
674                                          }
675                                          importCommand += " ../GameDataFolder/" + dir_itr->path().filename() + ".dat >> Install.log";
676  
677 <                                        printf(statusString,"%d/%i\0",j,numberOfDats);  
677 >
678                                          setProgressBar( (int)(1000 * (float)(j-1) / (float)numberOfDats) ); //100% * dat we're on / total dats
679 <                                        setStatusArea("Importing " +  dir_itr->path().filename() + " " + statusString);
679 >                                        setStatusArea("Step " + lexical_cast<std::string>(j) + '/' + lexical_cast<std::string>(numberOfDats)+ ": Importing " +  dir_itr->path().filename() + " ");
680  
681                                          system(importCommand.c_str());
682  
# Line 633 | Line 685 | logfile.close();
685                          }
686                          catch ( const std::exception & ex )
687                          {
688 <        
689 <        remove("Install.log");
690 <        ofstream logfile("Install.log");
691 <        
692 <        
693 <                                        logfile << "Warning, exception " << ex.what() << "!";
694 <                                        setStatusArea("Warning, exception " + (string)ex.what() + "!");
695 < logfile.close();
688 >
689 >                                remove("Install.log");
690 >                                ofstream logfile("Install.log");
691 >
692 >
693 >                                logfile << "Warning, exception " << ex.what() << "!";
694 >                                setStatusArea("Warning, exception " + (string)ex.what() + "!");
695 >                                logfile.close();
696                          }}
697          }
698          logfile << "Writing config file";
699          writeInstalledMods(installedMods);
700          setProgressBar(1000);
701          setStatusArea("Done! You can now play Oni.");
650        
651                ptime end_time(second_clock::local_time());
652                time_period total_time (start_time, end_time);
653                        
654        
655                ofstream logfile2("Install.log", ios::app | ios::ate);
656                string outstring = (string)"\n\nGlobalization ended " + to_simple_string(end_time) + "\nThe process took ";// + (string)total_time.length();
657                
658                logfile2 << "\nGlobalization ended " << to_simple_string(end_time) << "\nThe process took " << total_time.length();
659                
660                //logfile2.write(outstring.c_str(), outstring.length());
661 logfile2.close();
702  
703 <                //total_time.length().hours();
704 <        
703 >        ptime end_time(second_clock::local_time());
704 >        time_period total_time (start_time, end_time);
705 >
706 >
707 >        ofstream logfile2("Install.log", ios::app | ios::ate);
708 >        string outstring = (string)"\n\nGlobalization ended " + to_simple_string(end_time) + "\nThe process took ";// + (string)total_time.length();
709 >
710 >        logfile2 << "\nGlobalization ended " << to_simple_string(end_time) << "\nThe process took " << total_time.length();
711 >
712 >        //logfile2.write(outstring.c_str(), outstring.length());
713 >        logfile2.close();
714 >
715 >        //total_time.length().hours();
716 >
717          Sleep(1000);
718          setProgressBar(0);
719 +        busy = 0;
720   }
721  
722   void writeInstalledMods(vector<string> installedMods)
# Line 775 | Line 828 | vector<ModPackage> globalPackages;
828   #endif
829  
830   ////@begin includes
831 < #include "about_window.h"
831 > #include "about.h"
832   ////@end includes
833  
834   #include "main_window.h"
835  
836   ////@begin XPM images
837 < #include "redo.xpm"
837 > #include "aelogosmall.xpm"
838 > #include "undo.xpm"
839   #include "fileopen.xpm"
840   #include "filesaveas.xpm"
841   #include "quit.xpm"
# Line 804 | Line 858 | IMPLEMENT_CLASS( MainWindow, wxFrame )
858   BEGIN_EVENT_TABLE( MainWindow, wxFrame )
859  
860   ////@begin MainWindow event table entries
861 < EVT_CHECKBOX( SelectAll_Checkbox, MainWindow::OnSelectAllCheckboxClick )
861 >    EVT_CHECKBOX( SelectAll_Checkbox, MainWindow::OnSelectAllCheckboxClick )
862  
863 < EVT_BUTTON( Refresh_Button, MainWindow::OnRefreshButtonClick )
863 >    EVT_BUTTON( Refresh_Button, MainWindow::OnRefreshButtonClick )
864  
865 < EVT_LISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Selected )
866 < EVT_CHECKLISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Toggled )
865 >    EVT_LISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Selected )
866 >    EVT_CHECKLISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Toggled )
867  
868 < EVT_UPDATE_UI( ID_STATUSBAR, MainWindow::OnStatusbarUpdate )
868 >    EVT_UPDATE_UI( ID_STATUSBAR, MainWindow::OnStatusbarUpdate )
869  
870 < EVT_BUTTON( Install_Button, MainWindow::OnInstallButtonClick )
870 >    EVT_BUTTON( Install_Button, MainWindow::OnInstallButtonClick )
871  
872 < EVT_RADIOBUTTON( Sep_RadioButton, MainWindow::OnSepRadioButtonSelected )
872 >    EVT_RADIOBUTTON( Sep_RadioButton, MainWindow::OnSepRadioButtonSelected )
873  
874 < EVT_RADIOBUTTON( NoSep_RadioButton, MainWindow::OnNoSepRadioButtonSelected )
874 >    EVT_RADIOBUTTON( NoSep_RadioButton, MainWindow::OnNoSepRadioButtonSelected )
875  
876 < EVT_RADIOBUTTON( Separated_RadioButton, MainWindow::OnSeparatedRadioButtonSelected )
876 >    EVT_RADIOBUTTON( Seperated_RadioButton, MainWindow::OnSeperatedRadioButtonSelected )
877  
878 < EVT_RADIOBUTTON( Complete_RadioButton, MainWindow::OnCompleteRadioButtonSelected )
878 >    EVT_RADIOBUTTON( Complete_RadioButton, MainWindow::OnCompleteRadioButtonSelected )
879  
880 < EVT_BUTTON( ReGlobalize_Button, MainWindow::OnReGlobalizeButtonClick )
880 >    EVT_BUTTON( ReGlobalize_Button, MainWindow::OnReGlobalizeButtonClick )
881  
882 < EVT_MENU( wxID_LOAD, MainWindow::OnLoadClick )
882 >    EVT_MENU( wxID_LOAD, MainWindow::OnLoadClick )
883  
884 < EVT_MENU( wxID_SAVE, MainWindow::OnSaveClick )
884 >    EVT_MENU( wxID_SAVE, MainWindow::OnSaveClick )
885  
886 < EVT_MENU( wxID_EXIT, MainWindow::OnExitClick )
886 >    EVT_MENU( wxID_EXIT, MainWindow::OnExitClick )
887  
888 < EVT_MENU( wxID_OPTIONS, MainWindow::OnOptionsClick )
888 >    EVT_MENU( wxID_OPTIONS, MainWindow::OnOptionsClick )
889  
890 < EVT_MENU( wxID_ABOUT, MainWindow::OnAboutClick )
890 >    EVT_MENU( wxID_ABOUT, MainWindow::OnAboutClick )
891  
892   ////@end MainWindow event table entries
893  
# Line 863 | Line 917 | MainWindow::MainWindow( wxWindow* parent
917   bool MainWindow::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
918   {
919          ////@begin MainWindow creation
920 <        wxFrame::Create( parent, id, caption, pos, size, style );
920 >    wxFrame::Create( parent, id, caption, pos, size, style );
921  
922 <        CreateControls();
923 <        SetIcon(GetIconResource(wxT("oni_special.ico")));
924 <        Centre();
871 <        
872 <        
922 >    CreateControls();
923 >    SetIcon(GetIconResource(wxT("aelogosmall.png")));
924 >    Centre();
925          ////@end MainWindow creation
926          return true;
927   }
# Line 893 | Line 945 | MainWindow::~MainWindow()
945   void MainWindow::Init()
946   {
947          ////@begin MainWindow member initialisation
948 <        MainSplitter = NULL;
949 <        SelectAll = NULL;
950 <        RefreshButton = NULL;
951 <        Mods_CheckboxList = NULL;
952 <        titleText = NULL;
953 <        creatorText = NULL;
954 <        descriptionText = NULL;
955 <        StatusArea = NULL;
956 <        ProgressBar = NULL;
957 <        InstallButton = NULL;
958 <        OptionsPanel = NULL;
959 <        SepRadio = NULL;
960 <        NoSepRadio = NULL;
961 <        SeparatedRadio = NULL;
962 <        CompleteRadio = NULL;
963 <        ReglobalizeButton = NULL;
948 >    MainSplitter = NULL;
949 >    SelectAll = NULL;
950 >    RefreshButton = NULL;
951 >    Mods_CheckboxList = NULL;
952 >    titleText = NULL;
953 >    creatorText = NULL;
954 >    descriptionText = NULL;
955 >    StatusArea = NULL;
956 >    ProgressBar = NULL;
957 >    InstallButton = NULL;
958 >    OptionsPanel = NULL;
959 >    SepRadio = NULL;
960 >    NoSepRadio = NULL;
961 >    SeperatedRadio = NULL;
962 >    CompleteRadio = NULL;
963 >    ReglobalizeButton = NULL;
964          ////@end MainWindow member initialisation
965  
966   }
# Line 923 | Line 975 | wxGauge* TheProgressBar;
975   void MainWindow::CreateControls()
976   {    
977          ////@begin MainWindow content construction
978 <        // Generated by DialogBlocks, 31/05/2009 19:03:55 (unregistered)
927 <
928 <        MainWindow* itemFrame1 = this;
978 >    MainWindow* itemFrame1 = this;
979  
980 <        wxMenuBar* menuBar = new wxMenuBar;
981 <        wxMenu* itemMenu37 = new wxMenu;
982 <        {
983 <                wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_LOAD, _("&Load Configuration..."), wxEmptyString, wxITEM_NORMAL);
984 <                wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("fileopen.xpm")));
985 <                menuItem->SetBitmap(bitmap);
986 <                itemMenu37->Append(menuItem);
987 <        }
988 <        {
989 <                wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_SAVE, _("&Save Configuration..."), wxEmptyString, wxITEM_NORMAL);
990 <                wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("filesaveas.xpm")));
991 <                menuItem->SetBitmap(bitmap);
992 <                itemMenu37->Append(menuItem);
993 <        }
994 <        itemMenu37->AppendSeparator();
995 <        {
996 <                wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_EXIT, _("Exit"), wxEmptyString, wxITEM_NORMAL);
997 <                wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("quit.xpm")));
998 <                menuItem->SetBitmap(bitmap);
999 <                itemMenu37->Append(menuItem);
1000 <        }
1001 <        menuBar->Append(itemMenu37, _("&File"));
1002 <        wxMenu* itemMenu42 = new wxMenu;
1003 <        itemMenu42->Append(wxID_OPTIONS, _("Show Advanced Options..."), wxEmptyString, wxITEM_CHECK);
1004 <        menuBar->Append(itemMenu42, _("Options"));
1005 <        wxMenu* itemMenu44 = new wxMenu;
1006 <        itemMenu44->Append(wxID_HELP, _("Help"), wxEmptyString, wxITEM_NORMAL);
980 >    wxMenuBar* menuBar = new wxMenuBar;
981 >    wxMenu* itemMenu37 = new wxMenu;
982 >    {
983 >        wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_LOAD, _("&Load Configuration..."), wxEmptyString, wxITEM_NORMAL);
984 >        wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("fileopen.xpm")));
985 >        menuItem->SetBitmap(bitmap);
986 >        itemMenu37->Append(menuItem);
987 >    }
988 >    {
989 >        wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_SAVE, _("&Save Configuration..."), wxEmptyString, wxITEM_NORMAL);
990 >        wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("filesaveas.xpm")));
991 >        menuItem->SetBitmap(bitmap);
992 >        itemMenu37->Append(menuItem);
993 >    }
994 >    itemMenu37->AppendSeparator();
995 >    {
996 >        wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_EXIT, _("Exit"), wxEmptyString, wxITEM_NORMAL);
997 >        wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("quit.xpm")));
998 >        menuItem->SetBitmap(bitmap);
999 >        itemMenu37->Append(menuItem);
1000 >    }
1001 >    menuBar->Append(itemMenu37, _("&File"));
1002 >    wxMenu* itemMenu42 = new wxMenu;
1003 >    itemMenu42->Append(wxID_OPTIONS, _("Show Advanced Options..."), wxEmptyString, wxITEM_CHECK);
1004 >    menuBar->Append(itemMenu42, _("Options"));
1005 >    wxMenu* itemMenu44 = new wxMenu;
1006 > #ifdef WIN32
1007          itemMenu44->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
1008          menuBar->Append(itemMenu44, _("Help"));
1009 <        itemFrame1->SetMenuBar(menuBar);
1009 > #else
1010 >        itemMenu37->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
1011 > #endif  
1012 >
1013 >    itemFrame1->SetMenuBar(menuBar);
1014  
1015 <        wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
1016 <        itemFrame1->SetSizer(itemBoxSizer2);
1015 >    wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
1016 >    itemFrame1->SetSizer(itemBoxSizer2);
1017  
1018 <        MainSplitter = new wxSplitterWindow( itemFrame1, ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(100, 100), wxSP_LIVE_UPDATE|wxNO_BORDER );
1019 <        MainSplitter->SetMinimumPaneSize(150);
1020 <        MainSplitter->SetName(_T("MainSplitter"));
1021 <
1022 <        wxPanel* itemPanel4 = new wxPanel( MainSplitter, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1023 <        wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
1024 <        itemPanel4->SetSizer(itemBoxSizer5);
1025 <
1026 <        wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
1027 <        itemBoxSizer5->Add(itemBoxSizer6, 0, wxGROW|wxALL, 0);
1028 <        SelectAll = new wxCheckBox( itemPanel4, SelectAll_Checkbox, _("Select All/None"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE );
1029 <        SelectAll->SetValue(false);
1030 <        SelectAll->SetName(_T("SelectAll_Checkbox"));
1031 <        itemBoxSizer6->Add(SelectAll, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1032 <
1033 <        RefreshButton = new wxBitmapButton( itemPanel4, Refresh_Button, itemFrame1->GetBitmapResource(wxT("redo.xpm")), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
1034 <        RefreshButton->SetName(_T("RefreshButton"));
1035 <        itemBoxSizer6->Add(RefreshButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
1036 <
1037 <        wxArrayString Mods_CheckboxListStrings;
1038 <        Mods_CheckboxList = new wxCheckListBox( itemPanel4, Mods_CheckboxList1, wxDefaultPosition, wxDefaultSize, Mods_CheckboxListStrings, wxLB_HSCROLL );
1039 <        Mods_CheckboxList->SetName(_T("Mods_CheckboxList"));
1040 <        itemBoxSizer5->Add(Mods_CheckboxList, 1, wxGROW|wxALL, 0);
1041 <
1042 <        wxPanel* itemPanel10 = new wxPanel( MainSplitter, DescriptionHolder_Panel, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1043 <        itemPanel10->SetName(_T("DescriptionHolder_Panel"));
1044 <        wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL);
1045 <        itemPanel10->SetSizer(itemBoxSizer11);
1046 <
1047 <        wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
1048 <        itemBoxSizer11->Add(itemBoxSizer12, 0, wxGROW|wxALL, 0);
1049 <        wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL);
1050 <        itemBoxSizer12->Add(itemBoxSizer13, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0);
1051 <        titleText = new wxTextCtrl( itemPanel10, Title_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
1052 <        titleText->SetName(_T("Title_Text"));
1053 <        titleText->SetBackgroundColour(wxColour(240, 240, 240));
1054 <        itemBoxSizer13->Add(titleText, 1, wxGROW|wxLEFT, 5);
1055 <
1056 <        wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxVERTICAL);
1057 <        itemBoxSizer12->Add(itemBoxSizer15, 1, wxGROW|wxALL, 0);
1058 <        creatorText = new wxTextCtrl( itemPanel10, Author_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_RIGHT );
1059 <        creatorText->SetName(_T("Author_Text"));
1060 <        creatorText->SetBackgroundColour(wxColour(240, 240, 240));
1061 <        itemBoxSizer15->Add(creatorText, 1, wxGROW|wxRIGHT, 5);
1062 <
1063 <        wxStaticLine* itemStaticLine17 = new wxStaticLine( itemPanel10, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
1064 <        itemStaticLine17->Show(false);
1065 <        itemBoxSizer11->Add(itemStaticLine17, 0, wxGROW|wxALL, 5);
1066 <
1067 <        descriptionText = new wxTextCtrl( itemPanel10, Description_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH|wxTE_AUTO_URL );
1068 <        descriptionText->SetName(_T("DescriptionName"));
1069 <        descriptionText->SetBackgroundColour(wxColour(240, 240, 240));
1070 <        itemBoxSizer11->Add(descriptionText, 1, wxGROW|wxLEFT|wxRIGHT, 5);
1071 <
1072 <        MainSplitter->SplitVertically(itemPanel4, itemPanel10, 150);
1073 <        itemBoxSizer2->Add(MainSplitter, 1, wxGROW|wxALL, 0);
1074 <
1075 <        StatusArea = new wxStatusBar( itemFrame1, ID_STATUSBAR, 0 );
1076 <        StatusArea->SetName(_T("StatusArea"));
1077 <        StatusArea->SetFieldsCount(1);
1078 <        StatusArea->SetStatusText(_("Status Area"), 0);
1079 <        itemBoxSizer2->Add(StatusArea, 0, wxGROW|wxALL, 0);
1080 <
1081 <        wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL);
1082 <        itemBoxSizer2->Add(itemBoxSizer20, 0, wxGROW|wxALL, 0);
1083 <
1084 <        ProgressBar = new wxGauge( itemFrame1, ProgressBar_Gauge, 1000, wxDefaultPosition, wxSize(-1, 30), wxGA_SMOOTH );
1085 <        ProgressBar->SetValue(0);
1086 <        itemBoxSizer20->Add(ProgressBar, 1, wxGROW|wxALL, 0);
1087 <
1088 <        InstallButton = new wxButton( itemFrame1, Install_Button, _("Install!"), wxDefaultPosition, wxSize(-1, 30), 0 );
1089 <        itemBoxSizer20->Add(InstallButton, 0, wxGROW|wxALL, 0);
1090 <
1091 <        wxBoxSizer* itemBoxSizer23 = new wxBoxSizer(wxVERTICAL);
1092 <        itemBoxSizer2->Add(itemBoxSizer23, 0, wxGROW|wxALL, 0);
1093 <
1094 <        OptionsPanel = new wxPanel( itemFrame1, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1095 <        itemBoxSizer2->Add(OptionsPanel, 0, wxGROW, 0);
1096 <
1097 <        wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxHORIZONTAL);
1098 <        OptionsPanel->SetSizer(itemBoxSizer25);
1099 <
1100 <        wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxVERTICAL);
1101 <        itemBoxSizer25->Add(itemBoxSizer26, 0, wxGROW|wxALL, 5);
1102 <
1103 <        SepRadio = new wxRadioButton( OptionsPanel, Sep_RadioButton, _("Sep"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1104 <        SepRadio->SetValue(false);
1105 <        if (MainWindow::ShowToolTips())
1106 <                SepRadio->SetToolTip(_("For PC Demo and Mac"));
1107 <        itemBoxSizer26->Add(SepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1108 <
1109 <        NoSepRadio = new wxRadioButton( OptionsPanel, NoSep_RadioButton, _("NoSep"), wxDefaultPosition, wxDefaultSize, 0 );
1110 <        NoSepRadio->SetValue(false);
1111 <        if (MainWindow::ShowToolTips())
1112 <                NoSepRadio->SetToolTip(_("For PC Retail"));
1113 <        itemBoxSizer26->Add(NoSepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1114 <
1115 <        wxStaticLine* itemStaticLine29 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1116 <        itemBoxSizer25->Add(itemStaticLine29, 0, wxGROW|wxALL, 5);
1117 <
1118 <        wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxVERTICAL);
1119 <        itemBoxSizer25->Add(itemBoxSizer30, 0, wxGROW|wxALL, 5);
1120 <
1121 <        SeparatedRadio = new wxRadioButton( OptionsPanel, Separated_RadioButton, _("Separated Level0"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1122 <        SeparatedRadio->SetValue(false);
1123 <        SeparatedRadio->SetName(_T("Separated_RadioButton"));
1124 <        itemBoxSizer30->Add(SeparatedRadio, 0, wxALIGN_LEFT|wxALL, 5);
1125 <
1126 <        CompleteRadio = new wxRadioButton( OptionsPanel, Complete_RadioButton, _("Complete Level0"), wxDefaultPosition, wxDefaultSize, 0 );
1127 <        CompleteRadio->SetValue(false);
1128 <        CompleteRadio->SetName(_T("Complete_RadioButton"));
1129 <        itemBoxSizer30->Add(CompleteRadio, 0, wxALIGN_LEFT|wxALL, 5);
1130 <
1131 <        wxStaticLine* itemStaticLine33 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1132 <        itemBoxSizer25->Add(itemStaticLine33, 0, wxGROW|wxALL, 5);
1133 <
1134 <        wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxVERTICAL);
1135 <        itemBoxSizer25->Add(itemBoxSizer34, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1136 <
1137 <        ReglobalizeButton = new wxButton( OptionsPanel, ReGlobalize_Button, _("Reglobalize"), wxDefaultPosition, wxDefaultSize, 0 );
1138 <        ReglobalizeButton->SetName(_T("Reglobalize_Button"));
1139 <        itemBoxSizer34->Add(ReglobalizeButton, 0, wxGROW|wxALL, 5);
1018 >    MainSplitter = new wxSplitterWindow( itemFrame1, ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(100, 100), wxSP_LIVE_UPDATE|wxNO_BORDER );
1019 >    MainSplitter->SetMinimumPaneSize(1);
1020 >    MainSplitter->SetName(_T("MainSplitter"));
1021 >
1022 >    wxPanel* itemPanel4 = new wxPanel( MainSplitter, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1023 >    wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
1024 >    itemPanel4->SetSizer(itemBoxSizer5);
1025 >
1026 >    wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
1027 >    itemBoxSizer5->Add(itemBoxSizer6, 0, wxGROW|wxALL, 0);
1028 >    SelectAll = new wxCheckBox( itemPanel4, SelectAll_Checkbox, _("Select All/None"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE );
1029 >    SelectAll->SetValue(false);
1030 >    SelectAll->SetName(_T("SelectAll_Checkbox"));
1031 >    itemBoxSizer6->Add(SelectAll, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1032 >
1033 >    RefreshButton = new wxBitmapButton( itemPanel4, Refresh_Button, itemFrame1->GetBitmapResource(wxT("undo.xpm")), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
1034 >    RefreshButton->SetName(_T("RefreshButton"));
1035 >    itemBoxSizer6->Add(RefreshButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
1036 >
1037 >    wxArrayString Mods_CheckboxListStrings;
1038 >    Mods_CheckboxList = new wxCheckListBox( itemPanel4, Mods_CheckboxList1, wxDefaultPosition, wxDefaultSize, Mods_CheckboxListStrings, wxLB_HSCROLL );
1039 >    Mods_CheckboxList->SetName(_T("Mods_CheckboxList"));
1040 >    itemBoxSizer5->Add(Mods_CheckboxList, 1, wxGROW|wxALL, 0);
1041 >
1042 >    wxPanel* itemPanel10 = new wxPanel( MainSplitter, DescriptionHolder_Panel, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1043 >    itemPanel10->SetName(_T("DescriptionHolder_Panel"));
1044 >    wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL);
1045 >    itemPanel10->SetSizer(itemBoxSizer11);
1046 >
1047 >    wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
1048 >    itemBoxSizer11->Add(itemBoxSizer12, 0, wxGROW|wxALL, 0);
1049 >    wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL);
1050 >    itemBoxSizer12->Add(itemBoxSizer13, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0);
1051 >    titleText = new wxTextCtrl( itemPanel10, Title_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
1052 >    titleText->SetName(_T("Title_Text"));
1053 >    titleText->SetBackgroundColour(wxColour(240, 240, 240));
1054 >    itemBoxSizer13->Add(titleText, 1, wxGROW|wxLEFT, 5);
1055 >
1056 >    wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxVERTICAL);
1057 >    itemBoxSizer12->Add(itemBoxSizer15, 1, wxGROW|wxALL, 0);
1058 >    creatorText = new wxTextCtrl( itemPanel10, Author_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_RIGHT );
1059 >    creatorText->SetName(_T("Author_Text"));
1060 >    creatorText->SetBackgroundColour(wxColour(240, 240, 240));
1061 >    itemBoxSizer15->Add(creatorText, 1, wxGROW|wxRIGHT, 5);
1062 >
1063 >    wxStaticLine* itemStaticLine17 = new wxStaticLine( itemPanel10, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
1064 >    itemStaticLine17->Show(false);
1065 >    itemBoxSizer11->Add(itemStaticLine17, 0, wxGROW|wxALL, 5);
1066 >
1067 >    descriptionText = new wxTextCtrl( itemPanel10, Description_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH|wxTE_RICH2 );
1068 >    descriptionText->SetName(_T("DescriptionName"));
1069 >    descriptionText->SetBackgroundColour(wxColour(240, 240, 240));
1070 >    itemBoxSizer11->Add(descriptionText, 1, wxGROW|wxLEFT|wxRIGHT, 5);
1071 >
1072 >    MainSplitter->SplitVertically(itemPanel4, itemPanel10, 200);
1073 >    itemBoxSizer2->Add(MainSplitter, 1, wxGROW|wxALL, 0);
1074 >
1075 >    StatusArea = new wxStatusBar( itemFrame1, ID_STATUSBAR, 0 );
1076 >    StatusArea->SetName(_T("StatusArea"));
1077 >    StatusArea->SetFieldsCount(1);
1078 >    StatusArea->SetStatusText(_("AE Installer v1.0"), 0);
1079 >    itemBoxSizer2->Add(StatusArea, 0, wxGROW|wxALL, 0);
1080 >
1081 >    wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL);
1082 >    itemBoxSizer2->Add(itemBoxSizer20, 0, wxGROW|wxALL, 0);
1083 >
1084 >    ProgressBar = new wxGauge( itemFrame1, ProgressBar_Gauge, 1000, wxDefaultPosition, wxDefaultSize, wxGA_SMOOTH );
1085 >    ProgressBar->SetValue(0);
1086 >    itemBoxSizer20->Add(ProgressBar, 1, wxGROW|wxALL, 0);
1087 >
1088 >    InstallButton = new wxButton( itemFrame1, Install_Button, _("Install!"), wxDefaultPosition, wxDefaultSize, 0 );
1089 >    itemBoxSizer20->Add(InstallButton, 0, wxGROW|wxALL, 0);
1090 >
1091 >    wxBoxSizer* itemBoxSizer23 = new wxBoxSizer(wxVERTICAL);
1092 >    itemBoxSizer2->Add(itemBoxSizer23, 0, wxGROW|wxALL, 0);
1093 >
1094 >    OptionsPanel = new wxPanel( itemFrame1, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1095 >    itemBoxSizer2->Add(OptionsPanel, 0, wxGROW, 0);
1096 >
1097 >    wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxHORIZONTAL);
1098 >    OptionsPanel->SetSizer(itemBoxSizer25);
1099 >
1100 >    wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxVERTICAL);
1101 >    itemBoxSizer25->Add(itemBoxSizer26, 0, wxGROW|wxALL, 5);
1102 >
1103 >    SepRadio = new wxRadioButton( OptionsPanel, Sep_RadioButton, _("Sep"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1104 >    SepRadio->SetValue(false);
1105 >    if (MainWindow::ShowToolTips())
1106 >        SepRadio->SetToolTip(_("For PC Demo and Mac"));
1107 >    itemBoxSizer26->Add(SepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1108 >
1109 >    NoSepRadio = new wxRadioButton( OptionsPanel, NoSep_RadioButton, _("NoSep"), wxDefaultPosition, wxDefaultSize, 0 );
1110 >    NoSepRadio->SetValue(false);
1111 >    if (MainWindow::ShowToolTips())
1112 >        NoSepRadio->SetToolTip(_("For PC Retail"));
1113 >    itemBoxSizer26->Add(NoSepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1114 >
1115 >    wxStaticLine* itemStaticLine29 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1116 >    itemBoxSizer25->Add(itemStaticLine29, 0, wxGROW|wxALL, 5);
1117 >
1118 >    wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxVERTICAL);
1119 >    itemBoxSizer25->Add(itemBoxSizer30, 0, wxGROW|wxALL, 5);
1120 >
1121 >    SeperatedRadio = new wxRadioButton( OptionsPanel, Seperated_RadioButton, _("Separated Level0"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1122 >    SeperatedRadio->SetValue(false);
1123 >    SeperatedRadio->SetName(_T("Seperated_RadioButton"));
1124 >    itemBoxSizer30->Add(SeperatedRadio, 0, wxALIGN_LEFT|wxALL, 5);
1125 >
1126 >    CompleteRadio = new wxRadioButton( OptionsPanel, Complete_RadioButton, _("Complete Level0"), wxDefaultPosition, wxDefaultSize, 0 );
1127 >    CompleteRadio->SetValue(false);
1128 >    CompleteRadio->SetName(_T("Complete_RadioButton"));
1129 >    itemBoxSizer30->Add(CompleteRadio, 0, wxALIGN_LEFT|wxALL, 5);
1130 >
1131 >    wxStaticLine* itemStaticLine33 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1132 >    itemBoxSizer25->Add(itemStaticLine33, 0, wxGROW|wxALL, 5);
1133 >
1134 >    wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxVERTICAL);
1135 >    itemBoxSizer25->Add(itemBoxSizer34, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1136 >
1137 >    ReglobalizeButton = new wxButton( OptionsPanel, ReGlobalize_Button, _("Reglobalize"), wxDefaultPosition, wxDefaultSize, 0 );
1138 >    ReglobalizeButton->SetName(_T("Reglobalize_Button"));
1139 >    itemBoxSizer34->Add(ReglobalizeButton, 0, wxGROW|wxALL, 5);
1140  
1141 <        // Connect events and objects
1142 <        Mods_CheckboxList->Connect(Mods_CheckboxList1, wxEVT_CREATE, wxWindowCreateEventHandler(MainWindow::ModList_OnCreate), NULL, this);
1141 >    // Connect events and objects
1142 >    Mods_CheckboxList->Connect(Mods_CheckboxList1, wxEVT_CREATE, wxWindowCreateEventHandler(MainWindow::ModList_OnCreate), NULL, this);
1143          ////@end MainWindow content construction
1144 + #ifdef WIN32
1145 +        Handle = (HWND)GetHWND();
1146 +        ::CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_ITaskbarList, (void **)&pTaskbarList);
1147 + #endif
1148  
1149 <        if ( exists( "../../GameDataFolder/level0_Final.sep" ) ) {
1150 <                static_cast<string>("-import:sep");
1149 >        /*if ( exists( "../../GameDataFolder/level0_Final.sep" ) ) {
1150 >                strImportOption = "-import:sep";
1151                  splitInstances = NOT_SPLIT;
1152          }
1153          else {
1154 <                static_cast<string>("-import:nosep");
1154 >                strImportOption = "-import:nosep";
1155                  splitInstances = SPLIT;
1156 <        }
1157 <
1156 >        }*/
1157 >        
1158 > #ifndef WIN32
1159 >        strImportOption = "-import:sep";
1160 >        splitInstances = NOT_SPLIT;
1161 > #else
1162 >        strImportOption = "-import:nosep";
1163 >        splitInstances = SPLIT;
1164 > #endif
1165 >        
1166          globalPackages = getPackages();
1167          globalInstalledMods = getInstallString();
1168          for (int i = 0; i < globalPackages.size(); i++) {
# Line 1108 | Line 1174 | void MainWindow::CreateControls()
1174          TheInstallButton = InstallButton;
1175          TheProgressBar = ProgressBar;
1176          OptionsPanel->Hide();
1177 <        if(splitInstances == SPLIT) SeparatedRadio->SetValue(true);
1177 >        
1178 > //#ifndef WIN32
1179 > //      itemMenu37->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
1180 >        
1181 > //#endif
1182 >        
1183 >        if(splitInstances == SPLIT) SeperatedRadio->SetValue(true);
1184          else CompleteRadio->SetValue(true);
1113
1114
1115
1185          if(strImportOption == "-import:nosep") NoSepRadio->SetValue(true);
1186          else SepRadio->SetValue(true);
1187 <        
1188 <        
1187 >
1188 >
1189   #ifdef WIN32
1190          RedirectIOToConsole();
1191          HWND hWnd = GetConsoleWindow();
1192          ShowWindow( hWnd, SW_HIDE );
1193   #endif
1194 <        
1195 <                //MainWindow::SetSize(MainWindow::GetRect().GetWidth(), MainWindow::GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight() );
1194 >
1195 >        //MainWindow::SetSize(MainWindow::GetRect().GetWidth(), MainWindow::GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight() );
1196   }
1197  
1198  
# Line 1180 | Line 1249 | wxBitmap MainWindow::GetBitmapResource(
1249   {
1250          // Bitmap retrieval
1251          ////@begin MainWindow bitmap retrieval
1252 <        wxUnusedVar(name);
1253 <        if (name == _T("redo.xpm"))
1254 <        {
1255 <                wxBitmap bitmap(redo_xpm);
1256 <                return bitmap;
1257 <        }
1258 <        else if (name == _T("fileopen.xpm"))
1259 <        {
1260 <                wxBitmap bitmap( fileopen_xpm);
1261 <                return bitmap;
1262 <        }
1263 <        else if (name == _T("filesaveas.xpm"))
1264 <        {
1265 <                wxBitmap bitmap( filesaveas_xpm);
1266 <                return bitmap;
1267 <        }
1268 <        else if (name == _T("quit.xpm"))
1269 <        {
1270 <                wxBitmap bitmap( quit_xpm);
1271 <                return bitmap;
1272 <        }
1273 <        return wxNullBitmap;
1252 >    wxUnusedVar(name);
1253 >    if (name == _T("undo.xpm"))
1254 >    {
1255 >        wxBitmap bitmap( undo_xpm);
1256 >        return bitmap;
1257 >    }
1258 >    else if (name == _T("fileopen.xpm"))
1259 >    {
1260 >        wxBitmap bitmap( fileopen_xpm);
1261 >        return bitmap;
1262 >    }
1263 >    else if (name == _T("filesaveas.xpm"))
1264 >    {
1265 >        wxBitmap bitmap( filesaveas_xpm);
1266 >        return bitmap;
1267 >    }
1268 >    else if (name == _T("quit.xpm"))
1269 >    {
1270 >        wxBitmap bitmap( quit_xpm);
1271 >        return bitmap;
1272 >    }
1273 >    return wxNullBitmap;
1274          ////@end MainWindow bitmap retrieval
1275   }
1276  
# Line 1214 | Line 1283 | wxIcon MainWindow::GetIconResource( cons
1283  
1284          // Icon retrieval
1285          ////@begin MainWindow icon retrieval
1286 <        wxUnusedVar(name);
1287 <        if (name == _T("oni_special.ico"))
1288 <        {
1289 <        //      wxIcon icon(_T("oni_special.ico"), wxBITMAP_TYPE_ICO);
1290 <        //      return icon;
1291 <        }
1292 <        return wxNullIcon;
1286 >    wxUnusedVar(name);
1287 >    if (name == _T("aelogosmall.png"))
1288 >    {
1289 >        wxIcon icon(aelogosmall_xpm);
1290 >        return icon;
1291 >    }
1292 >    return wxNullIcon;
1293          ////@end MainWindow icon retrieval
1294   }
1295  
# Line 1268 | Line 1337 | void MainWindow::OnModsCheckboxList1Togg
1337  
1338   void MainWindow::OnOptionsClick( wxCommandEvent& event )
1339   {
1271
1272
1273        
1274
1340          if (!event.GetInt() ) {
1341                  OptionsPanel->Hide();
1342 <                MainWindow::SetSize(MainWindow::GetRect().GetWidth(), MainWindow::GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight());}
1342 >                
1343 >                this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight());}
1344          else {
1345 <                //Uncomment this when we release, it gets annoying if you are testing globalization a lot ;)
1346 <                //wxMessageDialog* YesNoDialog = new wxMessageDialog(this,                      "WARNING: These options are for advanced users only, use with caution.", "AE Installer Alert",  wxOK | wxICON_EXCLAMATION       , wxDefaultPosition);
1347 <                //YesNoDialog->ShowModal();
1345 > //              Uncomment this when we release, it gets annoying if you are testing globalization a lot ;)
1346 >                wxMessageDialog* YesNoDialog = new wxMessageDialog(this,                        "WARNING: These options are for advanced users only, use with caution.",
1347 >                                                                                                                   "AE Installer Alert",  wxOK | wxICON_EXCLAMATION     , wxDefaultPosition);
1348 >                YesNoDialog->ShowModal();
1349                  OptionsPanel->Show();
1350 <                MainWindow::SetSize(MainWindow::GetRect().GetWidth(), MainWindow::GetRect().GetHeight()+OptionsPanel->GetRect().GetHeight());
1350 >                this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()+OptionsPanel->GetRect().GetHeight()+1);
1351 >                this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()-1);
1352          }
1353   }
1354  
# Line 1320 | Line 1388 | void MainWindow::OnInstallButtonClick( w
1388          localPackages.push_back("Globalize");
1389          for(int i = 0; i < globalPackages.size(); i++) if(Mods_CheckboxList->IsChecked(i)) localPackages.push_back( globalPackages[i].modStringName );
1390          if ( !localPackages.empty() )   {
1391 <
1391 >        
1392                  //MainWindow::MainWindow().Hide();      
1393                  //      boost::thread thrd2(recompileAll(localPackages) );
1394                  //MainWindow::MainWindow().Show();
1395 +                this->InstallButton->Disable();
1396 +                this->ReglobalizeButton->Disable();
1397   #ifdef WIN32
1398                  recompile packages(localPackages);
1399                  boost::thread thrd(packages);
1400   #else
1331                this->Disable();
1401                  recompileAll(localPackages);
1333                this->Enable();
1402   #endif
1403  
1404 +                this->InstallButton->Enable();
1405 +                this->ReglobalizeButton->Enable();
1406          }
1407  
1408  
# Line 1352 | Line 1422 | void MainWindow::OnInstallButtonClick( w
1422  
1423   void setProgressBar( int i ) {
1424          //TheProgressBar->SetValue(
1425 + #ifdef WIN32
1426 +        
1427 +
1428 +
1429 + if (SUCCEEDED(pTaskbarList->QueryInterface(IID_ITaskbarList3, (void **)&pTaskbarList3)))
1430 + {
1431 +        
1432 +        pTaskbarList3->SetProgressValue(Handle,i, 1000);
1433 +        if ( i == 0 ) {
1434 +
1435 +        pTaskbarList3->SetProgressState(Handle,TBPF_NOPROGRESS);
1436 +        }
1437 + }
1438 +
1439  
1440 + #endif
1441          TheProgressBar->SetValue(i);
1442  
1443   }
# Line 1365 | Line 1450 | void setProgressBar( int i ) {
1450   void MainWindow::OnStatusbarUpdate( wxUpdateUIEvent& event )
1451   {
1452          ////@begin wxEVT_UPDATE_UI event handler for ID_STATUSBAR in MainWindow.
1453 <        // Before editing this code, remove the block markers.
1454 <        event.Skip();
1453 >    // Before editing this code, remove the block markers.
1454 >    event.Skip();
1455          ////@end wxEVT_UPDATE_UI event handler for ID_STATUSBAR in MainWindow.
1456   }
1457  
# Line 1378 | Line 1463 | void MainWindow::OnStatusbarUpdate( wxUp
1463   void MainWindow::OnAboutClick( wxCommandEvent& event )
1464   {
1465          ////@begin wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow.
1466 <        // Before editing this code, remove the block markers.
1467 <        About* window = new About(this);
1468 <        int returnValue = window->ShowModal();
1469 <        window->Destroy();
1466 >    // Before editing this code, remove the block markers.
1467 >    About* window = new About(this);
1468 >    int returnValue = window->ShowModal();
1469 >    window->Destroy();
1470          ////@end wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow.
1471   }
1472  
# Line 1410 | Line 1495 | void MainWindow::OnSepRadioButtonSelecte
1495   * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton
1496   */
1497  
1413 void MainWindow::OnSeparatedRadioButtonSelected( wxCommandEvent& event )
1414 {
1415        splitInstances = SPLIT;
1416
1417 }
1418
1419
1498   /*
1499   * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Complete_RadioButton
1500   */
# Line 1459 | Line 1537 | void MainWindow::refreshMods (vector<str
1537  
1538   void MainWindow::OnLoadClick( wxCommandEvent& event )
1539   {
1540 +        if (busy == 1) return;
1541          static const wxChar *FILETYPES = _T(
1542                  "Mod Loadouts (*.cfg)|*.cfg|"
1543                  "All files (*.*)|*.*"
# Line 1483 | Line 1562 | void MainWindow::OnLoadClick( wxCommandE
1562  
1563   void MainWindow::OnSaveClick( wxCommandEvent& event )
1564   {
1565 +        if (busy == 1) return;
1566          static const wxChar *FILETYPES = _T(
1567                  "Mod Loadouts (*.cfg)|*.cfg|"
1568                  "All files (*.*)|*.*"
# Line 1538 | Line 1618 | void MainWindow::OnSaveClick( wxCommandE
1618  
1619   void MainWindow::OnReGlobalizeButtonClick( wxCommandEvent& event )
1620   {
1621 <        wxMessageDialog* YesNoDialog = new wxMessageDialog(this,                        "WARNING: This will DELETE the Edition's GameDataFolder and reglobalize all of your data. \n Are you SURE you want to do this? ", "AE Installer Alert",  wxYES_NO | wxICON_EXCLAMATION  , wxDefaultPosition);
1621 >        wxMessageDialog* YesNoDialog = new wxMessageDialog(this,                        "WARNING: This will DELETE the Edition's GameDataFolder and recreate it from the vanilla Oni game data. \n Are you SURE you want to do this? ", "AE Installer Alert",  wxYES_NO | wxICON_EXCLAMATION    , wxDefaultPosition);
1622  
1623          if (YesNoDialog->ShowModal() == wxID_NO) { //if the user said no...
1624 <                
1624 >
1625          }
1626          else {
1547                
1627          
1628 +                this->InstallButton->Disable();
1629 +                this->ReglobalizeButton->Disable();
1630  
1631   #ifdef WIN32
1632  
1633 <        boost::thread thrd2(globalizeData);
1634 <        //globalizeData();
1635 <        //boost::thread::create_thread(&globalizeData);
1636 <        //       boost::thread_group Tg;
1637 <        // Tg.create_thread( &globalizeData(), this );
1633 >                boost::thread thrd2(globalizeData);
1634 >                //globalizeData();
1635 >                //boost::thread::create_thread(&globalizeData);
1636 >                //       boost::thread_group Tg;
1637 >                // Tg.create_thread( &globalizeData(), this );
1638   #else
1639 <        globalizeData();
1559 <        setProgressBar(1000);
1560 <        setStatusArea("Done!");
1639 >                globalizeData();
1640   #endif
1641 < }
1641 >                
1642 >                this->InstallButton->Enable();
1643 >                this->ReglobalizeButton->Enable();
1644 >        }
1645  
1646   }
1647   /*
# Line 1574 | Line 1656 | event.Skip();
1656   ////@end wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton in MainWindow.
1657   }*/
1658  
1659 +
1660 + /*
1661 + * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Seperated_RadioButton
1662 + */
1663 +
1664 + void MainWindow::OnSeperatedRadioButtonSelected( wxCommandEvent& event )
1665 + {
1666 + splitInstances = SPLIT;
1667 + }
1668 +

Diff Legend

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