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 385 by gumby, Mon Jul 6 00:59:40 2009 UTC

# Line 1 | Line 1
1   /*
2 < AE/Mod Installer
3 < by Gumby and Iritscen
2 > AE/Mod Installer
3 > by Gumby and Iritscen
4   */
5  
6 < // To-do: -
6 > // To-do: - Load credits from text resource file
7   //                - Institute lots of checks into file-handling
8 < //                - Clear mod info fields when mod is de-selected ???
8 > //                - Clear mod info fields when mod is de-selected
9  
10   #define DEBUG
11   #include <stdio.h>
# Line 30 | Line 30 | by Gumby and Iritscen
30   #include <dirent.h>
31   #endif
32  
33 < const string strInstallerVersion = "1.0";
33 > //const string strInstallerVersion = "1.0";
34   const bool SPLIT = 1;
35   const bool NOT_SPLIT = 0;
36   bool splitInstances = SPLIT;
37 <
37 > bool busy = 0;
38   #ifdef WIN32
39   const string strOniSplit = "Onisplit.exe";
40   string strImportOption = "-import:nosep";
# Line 60 | Line 60 | using namespace std;
60  
61   int globalizeData(void)
62   {
63 <            using boost::lexical_cast;
64 <    using boost::bad_lexical_cast;
65 < // using namespace boost::posix_time;
63 >        busy = 1;
64 >        using boost::lexical_cast;
65 >        using boost::bad_lexical_cast;
66 >        // using namespace boost::posix_time;
67          using namespace boost::gregorian;
68          using namespace boost::posix_time;
69          ptime start_time(second_clock::local_time());
# Line 76 | Line 77 | int globalizeData(void)
77          ofstream logfile("Globalize.log");
78          logfile << "Globalization started " << to_simple_string(start_time) << endl;
79          try {
80 <                
80 >
81                  char levels_cstr[15][3] = {"0", "1", "2", "3", "4", "6", "8", "9", "10", "11", "12", "13", "14", "18", "19"}; // the levels Oni has...probably should have made a string array. Oops.
82                  //const vector<double> ck(cv, &cv[CvSize]);
83                  vector<string> levels;
# Line 95 | Line 96 | int globalizeData(void)
96                  path Animations = "../GameDataFolder/level0_Animations";
97                  path TRAC = Animations / "level0_TRAC";
98                  path TRAM = Animations / "level0_TRAM";
99 <                
99 >
100                  vector<path> GDFPaths;
101                  GDFPaths.push_back(Characters);
102                  GDFPaths.push_back(Particles);
# Line 103 | Line 104 | int globalizeData(void)
104                  GDFPaths.push_back(Sounds);
105                  GDFPaths.push_back(TRAC);
106                  GDFPaths.push_back(TRAM);
107 <                
108 <                        
107 >
108 >
109                  path VanillaCharacters = "packages/VanillaDats/level0_Final/level0_Characters/level0_Characters.oni";
110                  path VanillaParticles = "packages/VanillaDats/level0_Final/level0_Particles/level0_Particles.oni";
111                  path VanillaTextures  = "packages/VanillaDats/level0_Final/level0_Textures/level0_Textures.oni";
# Line 114 | Line 115 | int globalizeData(void)
115                  path VanillaTRAM = "packages/VanillaDats/level0_Final/level0_Animations/level0_TRAM.oni";
116  
117                  vector<path> VanillaPaths;
118 <                
118 >
119                  VanillaPaths.push_back(VanillaCharacters);
120                  VanillaPaths.push_back(VanillaParticles);
121                  VanillaPaths.push_back(VanillaTextures);
122                  VanillaPaths.push_back(VanillaSounds);
123                  VanillaPaths.push_back(VanillaTRAC);
124                  VanillaPaths.push_back(VanillaTRAM);
125 <                
125 >
126                  /*
127                  if (exists("../GameDataFolder/"))
128                  {
# Line 142 | Line 143 | int globalizeData(void)
143                  setStatusArea("Creating needed directories...");
144                  logfile <<  "Creating needed directories...\n";
145                  create_directory( "../GameDataFolder/" );
146 <                
146 >
147                  create_directory( "packages" );
148 <                
148 >
149                  if (exists("packages/VanillaDats")) remove_all("packages/VanillaDats");
150                  create_directory( "packages/VanillaDats" );
151 <                
151 >
152                  create_directory( "packages/VanillaDats/level0_Final/" );
153                  //blah blah finish this.
154                  //logfile <<  "packages/VanillaDats/level0_Final/ created";
# Line 162 | Line 163 | int globalizeData(void)
163                  int num_levels = 0;
164                  for(int i = 1; i < 15; i++)
165                  {
166 <                                if (exists("../../GameDataFolder/level" + levels[i] + "_Final.dat")) {
166 >                        if (exists("../../GameDataFolder/level" + levels[i] + "_Final.dat")) {
167                                  num_levels++;
168  
169                          }
# Line 171 | Line 172 | int globalizeData(void)
172                  int total_steps =  8 + 2 * num_levels;
173                  for(int i = 0; i < 15; i++)
174                  {
175 <                        
175 >
176                          //printf(levels[i],"%d",levels[i]); // int to char array
177 <                        
177 >
178                          if (exists("../../GameDataFolder/level" + levels[i] + "_Final.dat")) {
179                                  logfile << "level" << levels[i] << "_Final\n";
180                                  logfile << "\tExporting level" << levels[i] << "_Final.dat\n";
181                                  //printf(Step_x_x,"Step %d/%d: exporting level%d_final.dat", parts_done + 1,, levels[i]); setStatusArea((string)Step_x_x);
182                                  setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + " exporting level" + levels[i]+"_Final.dat");
183                                  create_directory( "../GameDataFolder/level" + levels[i] + "_Final" );
184 < //                              setStatusArea(strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat");
184 >                                //                              setStatusArea(strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat");
185                                  system((strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat").c_str());
186                                  create_directory( "packages/VanillaDats/level" + levels[i] + "_Final" );
187                                  create_directory( "packages/VanillaDats/level" + levels[i] + "_Final/level" + levels[i] + "_Final" );
# Line 256 | Line 257 | int globalizeData(void)
257                                                  else if (dir_itr->path().filename().substr(0,4) == "AGDB"
258                                                          || dir_itr->path().filename().substr(0,4) == "TRCM") {
259                                                                  cout <<dir_itr->path().filename() << "\n";
260 <                                        
260 >
261                                                                  if(!exists( Archive / dir_itr->filename())) rename(dir_itr->path(), Archive / dir_itr->filename());
262                                                                  else remove(dir_itr->path());
263                                                  }
# Line 264 | Line 265 | int globalizeData(void)
265  
266                                                  }
267                                                  else {
268 <                                                        logfile << "\tMoved file: " << dir_itr->path().filename() << "\n";
268 >                                                        //logfile << "\tMoved file: " << dir_itr->path().filename() << "\n";
269                                                  }
270                                          }
271  
272  
273 <                                                
273 >
274                                  }
275                                  logfile << "\tCleaning up TXMPs...\n";
276                                  system( (strOniSplit + " -move:delete " + Textures.string() + " ../GameDataFolder/level" + levels[i] + "_Final/TXMP*.oni").c_str());
277                                  parts_done++;
278  
279                                  setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) ));
280 <                                
280 >
281                          }
282                  }
283                  logfile << "Reimporting levels\n";
# Line 286 | Line 287 | int globalizeData(void)
287                          //printf(levels[i],"%d",levels[i]);
288                          //printf(Step_x_x,"Step %d/%d: reimporting level", parts_done + 1, 7 + 2 * num_levels); setStatusArea((string)Step_x_x + levels[i] + (string)"_Final.dat");
289                          setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + " reimporting level" + levels[i]+"_Final.oni");
290 <                        system( (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level"
291 <                                + levels[i] + "_Final/level" + levels[i] + "_Final.oni > Globalize.oni").c_str());
290 >                        logfile << (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level"
291 >                                + levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize.log").c_str() << '\n';
292 >                        string sys_str = (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level"
293 >                                + levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize2.log");
294 >                                system(sys_str.c_str() );
295                          setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) ));
296 <                                parts_done++;
296 >                        parts_done++;
297                  }
298                  create_directory( VanillaCharacters.parent_path() );
299                  create_directory( VanillaParticles.parent_path() );
300                  create_directory( VanillaTextures.parent_path() );
301                  create_directory( VanillaSounds.parent_path() );
302                  create_directory( VanillaAnimations.remove_filename() );
303 <                
303 >
304                  for(int j = 0; j < GDFPaths.size(); j++) {
305                          logfile << "\tReimporting " << GDFPaths[j].filename() << ".oni\n";
306 <                        setStatusArea("Step" + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + ": reimporting " + GDFPaths[j].filename() );
306 >                        setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + ": reimporting " + GDFPaths[j].filename() );
307                          system((strOniSplit + " " + strImportOption + " " + GDFPaths[j].string() + " " + VanillaPaths[j].string()).c_str());
308                          parts_done++;
309                          setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) ));
310                  }
311 < /*
311 >                /*
312                  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) ));
313                  system((strOniSplit + " " + strImportOption + " " + Characters.string() + " " + VanillaCharacters.string()).c_str());
314                  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 324 | int globalizeData(void)
324                  system((strOniSplit + " " + strImportOption + " " + TRAM.string() + " " + VanillaTRAM.string()).c_str());
325                  //parts_done++; setStatusArea((string)"Copying level scripts...");setProgressBar( (int)(1000 * (float)(parts_done) / (float)(7 + 2 * num_levels) ));
326                  if (exists("../GameDataFolder/IGMD")) remove_all("../GameDataFolder/IGMD");
327 < */
327 >                */
328                  create_directory((path)"../GameDataFolder/IGMD");
329 <                copy((path)"packages/VanillaBSL/", (path)"../GameDataFolder");
330 <                setProgressBar( 1000 );
327 <                setStatusArea((string)"Done! Now select your mod packages and click install.");
328 <        //      while(1) Sleep(-1);
329 >                copy((path)"packages/VanillaBSL/IGMD", (path)"../GameDataFolder");
330 >                setProgressBar( 1000 );
331                  
332 +                // 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/
333 +                
334 +                // CIP:then copy persist.dat and keyconfig.txt into edition/ as well
335 +                
336 + #ifndef WIN32
337 +                /* 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).
338 +                   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,
339 +                   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 */
340 +                path fullAEpath = system_complete("."); // get full path for Installer
341 +                char prefsCommand[300] = "defaults write com.godgames.oni RetailInstallationPath -string '";
342 +                strcat(prefsCommand, fullAEpath.parent_path().parent_path().string().c_str()); // get path of edition/ folder (Oni wants the folder that *contains* the GDF)
343 +                strcat(prefsCommand, "'"); // path string is enclosed in single quotes to avoid the need to escape UNIX-unfriendly characters
344 +                system(prefsCommand);
345 +                
346 + #endif
347 +                
348 +                setStatusArea((string)"Done! Now select your mod packages and click install.");
349 +                //      while(1) Sleep(-1);
350 +
351          }
352          catch (exception ex) {
353                  setStatusArea("Warning, handled exception: " + (string)ex.what());
354          }
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();
355  
356 +        ptime end_time(second_clock::local_time());
357 +        time_period total_time (start_time, end_time);
358 +        logfile << "\n\nGlobalization ended " << to_simple_string(end_time) << "\nThe process took " << total_time.length();
359 +        //total_time.length().hours();
360 +        logfile.close();
361 +        busy = 0;
362          return err;
363   }
364  
# Line 490 | Line 511 | ModPackage fileToModPackage(fstream &fil
511  
512   void recompileAll(vector<string> installedMods)
513   {
514 +        busy = 1;
515          using namespace boost::gregorian;
516          using namespace boost::posix_time;
517 +        using boost::lexical_cast;
518 +        using boost::bad_lexical_cast;
519          
520          setStatusArea("Importing levels...");
521          //setStatusArea("Recompiling Data...");
# Line 550 | Line 574 | void recompileAll(vector<string> install
574                                                  }
575                                                  importCommand += " ../GameDataFolder/" + dir_itr->path().filename() + ".dat >> Install.log";
576  
577 <                                                printf(statusString,"%d/%i\0",j,numberOfDats);  
577 >                                                
578                                                  setProgressBar( (int)(1000 * (float)(j-1) / (float)numberOfDats) ); //100% * dat we're on / total dats
579 <                                                setStatusArea("Importing " +  dir_itr->path().filename() + " " + statusString);
579 >                                                setStatusArea("Step " + lexical_cast<std::string>(j) + '/' + lexical_cast<std::string>(numberOfDats)+ ": Importing " +  dir_itr->path().filename() + " ");
580  
581                                                  system(importCommand.c_str());
582                                                  //Sleep(1000);
# Line 563 | Line 587 | void recompileAll(vector<string> install
587                                  }
588                                  catch ( const std::exception & ex )
589                                  {
590 <                                        
591 <        remove("Install.log");
592 <        ofstream logfile("Install.log");
593 <        
594 <        
590 >
591 >                                        remove("Install.log");
592 >                                        ofstream logfile("Install.log");
593 >
594 >
595                                          logfile << "Warning, exception " << ex.what() << "!";
596                                          setStatusArea("Warning, exception " + (string)ex.what() + "!");
597 < logfile.close();        
597 >                                        logfile.close();        
598                                  }
599                          }
600  
601                  }
602                  catch( const std::exception & ex ) {
603 <        
604 <        remove("Install.log");
605 <        ofstream logfile("Install.log");
606 <        
607 <        
608 <                                        logfile << "Warning, exception " << ex.what() << "!";
609 <                                        setStatusArea("Warning, exception " + (string)ex.what() + "!");
610 < logfile.close();
603 >
604 >                        remove("Install.log");
605 >                        ofstream logfile("Install.log");
606 >
607 >
608 >                        logfile << "Warning, exception " << ex.what() << "!";
609 >                        setStatusArea("Warning, exception " + (string)ex.what() + "!");
610 >                        logfile.close();
611                  }
612  
613          }
# Line 614 | Line 638 | logfile.close();
638                          {
639                                  if ( is_directory( dir_itr->status() ) )
640                                  {
641 <                                        importCommand = strOniSplit + " " + strImportOption + " " + vanilla_dir.string() + dir_itr->path().filename() + " " + "../GameDataFolder/" + dir_itr->path().filename()
618 <                                                + ".dat";
641 >                                        importCommand = strOniSplit + " " + strImportOption + " " + vanilla_dir.string() + dir_itr->path().filename() + " ";
642                                          for (int i = 0; i < installedMods.size(); ++i) {
643                                                  if (exists("packages/" + installedMods[i] + "/oni/" + dir_itr->path().filename()  ))
644                                                          importCommand += " packages/" + installedMods[i] + "/oni/" + dir_itr->path().filename();
645                                          }
646                                          importCommand += " ../GameDataFolder/" + dir_itr->path().filename() + ".dat >> Install.log";
647  
648 <                                        printf(statusString,"%d/%i\0",j,numberOfDats);  
648 >
649                                          setProgressBar( (int)(1000 * (float)(j-1) / (float)numberOfDats) ); //100% * dat we're on / total dats
650 <                                        setStatusArea("Importing " +  dir_itr->path().filename() + " " + statusString);
650 >                                        setStatusArea("Step " + lexical_cast<std::string>(j) + '/' + lexical_cast<std::string>(numberOfDats)+ ": Importing " +  dir_itr->path().filename() + " ");
651  
652                                          system(importCommand.c_str());
653  
# Line 633 | Line 656 | logfile.close();
656                          }
657                          catch ( const std::exception & ex )
658                          {
659 <        
660 <        remove("Install.log");
661 <        ofstream logfile("Install.log");
662 <        
663 <        
664 <                                        logfile << "Warning, exception " << ex.what() << "!";
665 <                                        setStatusArea("Warning, exception " + (string)ex.what() + "!");
666 < logfile.close();
659 >
660 >                                remove("Install.log");
661 >                                ofstream logfile("Install.log");
662 >
663 >
664 >                                logfile << "Warning, exception " << ex.what() << "!";
665 >                                setStatusArea("Warning, exception " + (string)ex.what() + "!");
666 >                                logfile.close();
667                          }}
668          }
669          logfile << "Writing config file";
670          writeInstalledMods(installedMods);
671          setProgressBar(1000);
672          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();
673  
674 <                //total_time.length().hours();
675 <        
674 >        ptime end_time(second_clock::local_time());
675 >        time_period total_time (start_time, end_time);
676 >
677 >
678 >        ofstream logfile2("Install.log", ios::app | ios::ate);
679 >        string outstring = (string)"\n\nGlobalization ended " + to_simple_string(end_time) + "\nThe process took ";// + (string)total_time.length();
680 >
681 >        logfile2 << "\nGlobalization ended " << to_simple_string(end_time) << "\nThe process took " << total_time.length();
682 >
683 >        //logfile2.write(outstring.c_str(), outstring.length());
684 >        logfile2.close();
685 >
686 >        //total_time.length().hours();
687 >
688          Sleep(1000);
689          setProgressBar(0);
690 +        busy = 0;
691   }
692  
693   void writeInstalledMods(vector<string> installedMods)
# Line 775 | Line 799 | vector<ModPackage> globalPackages;
799   #endif
800  
801   ////@begin includes
802 < #include "about_window.h"
802 > #include "about.h"
803   ////@end includes
804  
805   #include "main_window.h"
806  
807   ////@begin XPM images
808 < #include "redo.xpm"
808 > #include "aelogosmall.xpm"
809 > #include "undo.xpm"
810   #include "fileopen.xpm"
811   #include "filesaveas.xpm"
812   #include "quit.xpm"
# Line 804 | Line 829 | IMPLEMENT_CLASS( MainWindow, wxFrame )
829   BEGIN_EVENT_TABLE( MainWindow, wxFrame )
830  
831   ////@begin MainWindow event table entries
832 < EVT_CHECKBOX( SelectAll_Checkbox, MainWindow::OnSelectAllCheckboxClick )
832 >    EVT_CHECKBOX( SelectAll_Checkbox, MainWindow::OnSelectAllCheckboxClick )
833  
834 < EVT_BUTTON( Refresh_Button, MainWindow::OnRefreshButtonClick )
834 >    EVT_BUTTON( Refresh_Button, MainWindow::OnRefreshButtonClick )
835  
836 < EVT_LISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Selected )
837 < EVT_CHECKLISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Toggled )
836 >    EVT_LISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Selected )
837 >    EVT_CHECKLISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Toggled )
838  
839 < EVT_UPDATE_UI( ID_STATUSBAR, MainWindow::OnStatusbarUpdate )
839 >    EVT_UPDATE_UI( ID_STATUSBAR, MainWindow::OnStatusbarUpdate )
840  
841 < EVT_BUTTON( Install_Button, MainWindow::OnInstallButtonClick )
841 >    EVT_BUTTON( Install_Button, MainWindow::OnInstallButtonClick )
842  
843 < EVT_RADIOBUTTON( Sep_RadioButton, MainWindow::OnSepRadioButtonSelected )
843 >    EVT_RADIOBUTTON( Sep_RadioButton, MainWindow::OnSepRadioButtonSelected )
844  
845 < EVT_RADIOBUTTON( NoSep_RadioButton, MainWindow::OnNoSepRadioButtonSelected )
845 >    EVT_RADIOBUTTON( NoSep_RadioButton, MainWindow::OnNoSepRadioButtonSelected )
846  
847 < EVT_RADIOBUTTON( Separated_RadioButton, MainWindow::OnSeparatedRadioButtonSelected )
847 >    EVT_RADIOBUTTON( Seperated_RadioButton, MainWindow::OnSeperatedRadioButtonSelected )
848  
849 < EVT_RADIOBUTTON( Complete_RadioButton, MainWindow::OnCompleteRadioButtonSelected )
849 >    EVT_RADIOBUTTON( Complete_RadioButton, MainWindow::OnCompleteRadioButtonSelected )
850  
851 < EVT_BUTTON( ReGlobalize_Button, MainWindow::OnReGlobalizeButtonClick )
851 >    EVT_BUTTON( ReGlobalize_Button, MainWindow::OnReGlobalizeButtonClick )
852  
853 < EVT_MENU( wxID_LOAD, MainWindow::OnLoadClick )
853 >    EVT_MENU( wxID_LOAD, MainWindow::OnLoadClick )
854  
855 < EVT_MENU( wxID_SAVE, MainWindow::OnSaveClick )
855 >    EVT_MENU( wxID_SAVE, MainWindow::OnSaveClick )
856  
857 < EVT_MENU( wxID_EXIT, MainWindow::OnExitClick )
857 >    EVT_MENU( wxID_EXIT, MainWindow::OnExitClick )
858  
859 < EVT_MENU( wxID_OPTIONS, MainWindow::OnOptionsClick )
859 >    EVT_MENU( wxID_OPTIONS, MainWindow::OnOptionsClick )
860  
861 < EVT_MENU( wxID_ABOUT, MainWindow::OnAboutClick )
861 >    EVT_MENU( wxID_ABOUT, MainWindow::OnAboutClick )
862  
863   ////@end MainWindow event table entries
864  
# Line 863 | Line 888 | MainWindow::MainWindow( wxWindow* parent
888   bool MainWindow::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
889   {
890          ////@begin MainWindow creation
891 <        wxFrame::Create( parent, id, caption, pos, size, style );
891 >    wxFrame::Create( parent, id, caption, pos, size, style );
892  
893 <        CreateControls();
894 <        SetIcon(GetIconResource(wxT("oni_special.ico")));
895 <        Centre();
871 <        
872 <        
893 >    CreateControls();
894 >    SetIcon(GetIconResource(wxT("aelogosmall.png")));
895 >    Centre();
896          ////@end MainWindow creation
897          return true;
898   }
# Line 893 | Line 916 | MainWindow::~MainWindow()
916   void MainWindow::Init()
917   {
918          ////@begin MainWindow member initialisation
919 <        MainSplitter = NULL;
920 <        SelectAll = NULL;
921 <        RefreshButton = NULL;
922 <        Mods_CheckboxList = NULL;
923 <        titleText = NULL;
924 <        creatorText = NULL;
925 <        descriptionText = NULL;
926 <        StatusArea = NULL;
927 <        ProgressBar = NULL;
928 <        InstallButton = NULL;
929 <        OptionsPanel = NULL;
930 <        SepRadio = NULL;
931 <        NoSepRadio = NULL;
932 <        SeparatedRadio = NULL;
933 <        CompleteRadio = NULL;
934 <        ReglobalizeButton = NULL;
919 >    MainSplitter = NULL;
920 >    SelectAll = NULL;
921 >    RefreshButton = NULL;
922 >    Mods_CheckboxList = NULL;
923 >    titleText = NULL;
924 >    creatorText = NULL;
925 >    descriptionText = NULL;
926 >    StatusArea = NULL;
927 >    ProgressBar = NULL;
928 >    InstallButton = NULL;
929 >    OptionsPanel = NULL;
930 >    SepRadio = NULL;
931 >    NoSepRadio = NULL;
932 >    SeperatedRadio = NULL;
933 >    CompleteRadio = NULL;
934 >    ReglobalizeButton = NULL;
935          ////@end MainWindow member initialisation
936  
937   }
# Line 923 | Line 946 | wxGauge* TheProgressBar;
946   void MainWindow::CreateControls()
947   {    
948          ////@begin MainWindow content construction
949 <        // Generated by DialogBlocks, 31/05/2009 19:03:55 (unregistered)
949 >    MainWindow* itemFrame1 = this;
950  
951 <        MainWindow* itemFrame1 = this;
952 <
953 <        wxMenuBar* menuBar = new wxMenuBar;
954 <        wxMenu* itemMenu37 = new wxMenu;
955 <        {
956 <                wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_LOAD, _("&Load Configuration..."), wxEmptyString, wxITEM_NORMAL);
957 <                wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("fileopen.xpm")));
958 <                menuItem->SetBitmap(bitmap);
959 <                itemMenu37->Append(menuItem);
960 <        }
961 <        {
962 <                wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_SAVE, _("&Save Configuration..."), wxEmptyString, wxITEM_NORMAL);
963 <                wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("filesaveas.xpm")));
964 <                menuItem->SetBitmap(bitmap);
965 <                itemMenu37->Append(menuItem);
966 <        }
967 <        itemMenu37->AppendSeparator();
968 <        {
969 <                wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_EXIT, _("Exit"), wxEmptyString, wxITEM_NORMAL);
970 <                wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("quit.xpm")));
971 <                menuItem->SetBitmap(bitmap);
972 <                itemMenu37->Append(menuItem);
973 <        }
974 <        menuBar->Append(itemMenu37, _("&File"));
975 <        wxMenu* itemMenu42 = new wxMenu;
976 <        itemMenu42->Append(wxID_OPTIONS, _("Show Advanced Options..."), wxEmptyString, wxITEM_CHECK);
977 <        menuBar->Append(itemMenu42, _("Options"));
978 <        wxMenu* itemMenu44 = new wxMenu;
979 <        itemMenu44->Append(wxID_HELP, _("Help"), wxEmptyString, wxITEM_NORMAL);
980 <        itemMenu44->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
981 <        menuBar->Append(itemMenu44, _("Help"));
982 <        itemFrame1->SetMenuBar(menuBar);
983 <
984 <        wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
985 <        itemFrame1->SetSizer(itemBoxSizer2);
986 <
987 <        MainSplitter = new wxSplitterWindow( itemFrame1, ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(100, 100), wxSP_LIVE_UPDATE|wxNO_BORDER );
988 <        MainSplitter->SetMinimumPaneSize(150);
989 <        MainSplitter->SetName(_T("MainSplitter"));
990 <
991 <        wxPanel* itemPanel4 = new wxPanel( MainSplitter, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
992 <        wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
993 <        itemPanel4->SetSizer(itemBoxSizer5);
994 <
995 <        wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
996 <        itemBoxSizer5->Add(itemBoxSizer6, 0, wxGROW|wxALL, 0);
997 <        SelectAll = new wxCheckBox( itemPanel4, SelectAll_Checkbox, _("Select All/None"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE );
998 <        SelectAll->SetValue(false);
999 <        SelectAll->SetName(_T("SelectAll_Checkbox"));
1000 <        itemBoxSizer6->Add(SelectAll, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1001 <
1002 <        RefreshButton = new wxBitmapButton( itemPanel4, Refresh_Button, itemFrame1->GetBitmapResource(wxT("redo.xpm")), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
1003 <        RefreshButton->SetName(_T("RefreshButton"));
1004 <        itemBoxSizer6->Add(RefreshButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
1005 <
1006 <        wxArrayString Mods_CheckboxListStrings;
1007 <        Mods_CheckboxList = new wxCheckListBox( itemPanel4, Mods_CheckboxList1, wxDefaultPosition, wxDefaultSize, Mods_CheckboxListStrings, wxLB_HSCROLL );
1008 <        Mods_CheckboxList->SetName(_T("Mods_CheckboxList"));
1009 <        itemBoxSizer5->Add(Mods_CheckboxList, 1, wxGROW|wxALL, 0);
1010 <
1011 <        wxPanel* itemPanel10 = new wxPanel( MainSplitter, DescriptionHolder_Panel, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1012 <        itemPanel10->SetName(_T("DescriptionHolder_Panel"));
1013 <        wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL);
1014 <        itemPanel10->SetSizer(itemBoxSizer11);
1015 <
1016 <        wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
1017 <        itemBoxSizer11->Add(itemBoxSizer12, 0, wxGROW|wxALL, 0);
1018 <        wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL);
1019 <        itemBoxSizer12->Add(itemBoxSizer13, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0);
1020 <        titleText = new wxTextCtrl( itemPanel10, Title_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
1021 <        titleText->SetName(_T("Title_Text"));
1022 <        titleText->SetBackgroundColour(wxColour(240, 240, 240));
1023 <        itemBoxSizer13->Add(titleText, 1, wxGROW|wxLEFT, 5);
1024 <
1025 <        wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxVERTICAL);
1026 <        itemBoxSizer12->Add(itemBoxSizer15, 1, wxGROW|wxALL, 0);
1027 <        creatorText = new wxTextCtrl( itemPanel10, Author_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_RIGHT );
1028 <        creatorText->SetName(_T("Author_Text"));
1029 <        creatorText->SetBackgroundColour(wxColour(240, 240, 240));
1030 <        itemBoxSizer15->Add(creatorText, 1, wxGROW|wxRIGHT, 5);
1031 <
1032 <        wxStaticLine* itemStaticLine17 = new wxStaticLine( itemPanel10, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
1033 <        itemStaticLine17->Show(false);
1034 <        itemBoxSizer11->Add(itemStaticLine17, 0, wxGROW|wxALL, 5);
1035 <
1036 <        descriptionText = new wxTextCtrl( itemPanel10, Description_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH|wxTE_AUTO_URL );
1037 <        descriptionText->SetName(_T("DescriptionName"));
1038 <        descriptionText->SetBackgroundColour(wxColour(240, 240, 240));
1039 <        itemBoxSizer11->Add(descriptionText, 1, wxGROW|wxLEFT|wxRIGHT, 5);
1040 <
1041 <        MainSplitter->SplitVertically(itemPanel4, itemPanel10, 150);
1042 <        itemBoxSizer2->Add(MainSplitter, 1, wxGROW|wxALL, 0);
1043 <
1044 <        StatusArea = new wxStatusBar( itemFrame1, ID_STATUSBAR, 0 );
1045 <        StatusArea->SetName(_T("StatusArea"));
1046 <        StatusArea->SetFieldsCount(1);
1047 <        StatusArea->SetStatusText(_("Status Area"), 0);
1048 <        itemBoxSizer2->Add(StatusArea, 0, wxGROW|wxALL, 0);
1049 <
1050 <        wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL);
1051 <        itemBoxSizer2->Add(itemBoxSizer20, 0, wxGROW|wxALL, 0);
1052 <
1053 <        ProgressBar = new wxGauge( itemFrame1, ProgressBar_Gauge, 1000, wxDefaultPosition, wxSize(-1, 30), wxGA_SMOOTH );
1054 <        ProgressBar->SetValue(0);
1055 <        itemBoxSizer20->Add(ProgressBar, 1, wxGROW|wxALL, 0);
1056 <
1057 <        InstallButton = new wxButton( itemFrame1, Install_Button, _("Install!"), wxDefaultPosition, wxSize(-1, 30), 0 );
1058 <        itemBoxSizer20->Add(InstallButton, 0, wxGROW|wxALL, 0);
1059 <
1060 <        wxBoxSizer* itemBoxSizer23 = new wxBoxSizer(wxVERTICAL);
1061 <        itemBoxSizer2->Add(itemBoxSizer23, 0, wxGROW|wxALL, 0);
1062 <
1063 <        OptionsPanel = new wxPanel( itemFrame1, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1064 <        itemBoxSizer2->Add(OptionsPanel, 0, wxGROW, 0);
1065 <
1066 <        wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxHORIZONTAL);
1067 <        OptionsPanel->SetSizer(itemBoxSizer25);
1068 <
1069 <        wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxVERTICAL);
1070 <        itemBoxSizer25->Add(itemBoxSizer26, 0, wxGROW|wxALL, 5);
1071 <
1072 <        SepRadio = new wxRadioButton( OptionsPanel, Sep_RadioButton, _("Sep"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1073 <        SepRadio->SetValue(false);
1074 <        if (MainWindow::ShowToolTips())
1075 <                SepRadio->SetToolTip(_("For PC Demo and Mac"));
1076 <        itemBoxSizer26->Add(SepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1077 <
1078 <        NoSepRadio = new wxRadioButton( OptionsPanel, NoSep_RadioButton, _("NoSep"), wxDefaultPosition, wxDefaultSize, 0 );
1079 <        NoSepRadio->SetValue(false);
1080 <        if (MainWindow::ShowToolTips())
1081 <                NoSepRadio->SetToolTip(_("For PC Retail"));
1082 <        itemBoxSizer26->Add(NoSepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1083 <
1084 <        wxStaticLine* itemStaticLine29 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1085 <        itemBoxSizer25->Add(itemStaticLine29, 0, wxGROW|wxALL, 5);
1086 <
1087 <        wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxVERTICAL);
1088 <        itemBoxSizer25->Add(itemBoxSizer30, 0, wxGROW|wxALL, 5);
1089 <
1090 <        SeparatedRadio = new wxRadioButton( OptionsPanel, Separated_RadioButton, _("Separated Level0"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1091 <        SeparatedRadio->SetValue(false);
1092 <        SeparatedRadio->SetName(_T("Separated_RadioButton"));
1093 <        itemBoxSizer30->Add(SeparatedRadio, 0, wxALIGN_LEFT|wxALL, 5);
1094 <
1095 <        CompleteRadio = new wxRadioButton( OptionsPanel, Complete_RadioButton, _("Complete Level0"), wxDefaultPosition, wxDefaultSize, 0 );
1096 <        CompleteRadio->SetValue(false);
1097 <        CompleteRadio->SetName(_T("Complete_RadioButton"));
1098 <        itemBoxSizer30->Add(CompleteRadio, 0, wxALIGN_LEFT|wxALL, 5);
1099 <
1100 <        wxStaticLine* itemStaticLine33 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1101 <        itemBoxSizer25->Add(itemStaticLine33, 0, wxGROW|wxALL, 5);
1102 <
1103 <        wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxVERTICAL);
1104 <        itemBoxSizer25->Add(itemBoxSizer34, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1105 <
1083 <        ReglobalizeButton = new wxButton( OptionsPanel, ReGlobalize_Button, _("Reglobalize"), wxDefaultPosition, wxDefaultSize, 0 );
1084 <        ReglobalizeButton->SetName(_T("Reglobalize_Button"));
1085 <        itemBoxSizer34->Add(ReglobalizeButton, 0, wxGROW|wxALL, 5);
951 >    wxMenuBar* menuBar = new wxMenuBar;
952 >    wxMenu* itemMenu37 = new wxMenu;
953 >    {
954 >        wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_LOAD, _("&Load Configuration..."), wxEmptyString, wxITEM_NORMAL);
955 >        wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("fileopen.xpm")));
956 >        menuItem->SetBitmap(bitmap);
957 >        itemMenu37->Append(menuItem);
958 >    }
959 >    {
960 >        wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_SAVE, _("&Save Configuration..."), wxEmptyString, wxITEM_NORMAL);
961 >        wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("filesaveas.xpm")));
962 >        menuItem->SetBitmap(bitmap);
963 >        itemMenu37->Append(menuItem);
964 >    }
965 >    itemMenu37->AppendSeparator();
966 >    {
967 >        wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_EXIT, _("Exit"), wxEmptyString, wxITEM_NORMAL);
968 >        wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("quit.xpm")));
969 >        menuItem->SetBitmap(bitmap);
970 >        itemMenu37->Append(menuItem);
971 >    }
972 >    menuBar->Append(itemMenu37, _("&File"));
973 >    wxMenu* itemMenu42 = new wxMenu;
974 >    itemMenu42->Append(wxID_OPTIONS, _("Show Advanced Options..."), wxEmptyString, wxITEM_CHECK);
975 >    menuBar->Append(itemMenu42, _("Options"));
976 >    wxMenu* itemMenu44 = new wxMenu;
977 >    itemMenu44->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
978 >    menuBar->Append(itemMenu44, _("Help"));
979 >    itemFrame1->SetMenuBar(menuBar);
980 >
981 >    wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
982 >    itemFrame1->SetSizer(itemBoxSizer2);
983 >
984 >    MainSplitter = new wxSplitterWindow( itemFrame1, ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(100, 100), wxSP_LIVE_UPDATE|wxNO_BORDER );
985 >    MainSplitter->SetMinimumPaneSize(1);
986 >    MainSplitter->SetName(_T("MainSplitter"));
987 >
988 >    wxPanel* itemPanel4 = new wxPanel( MainSplitter, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
989 >    wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
990 >    itemPanel4->SetSizer(itemBoxSizer5);
991 >
992 >    wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
993 >    itemBoxSizer5->Add(itemBoxSizer6, 0, wxGROW|wxALL, 0);
994 >    SelectAll = new wxCheckBox( itemPanel4, SelectAll_Checkbox, _("Select All/None"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE );
995 >    SelectAll->SetValue(false);
996 >    SelectAll->SetName(_T("SelectAll_Checkbox"));
997 >    itemBoxSizer6->Add(SelectAll, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
998 >
999 >    RefreshButton = new wxBitmapButton( itemPanel4, Refresh_Button, itemFrame1->GetBitmapResource(wxT("undo.xpm")), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
1000 >    RefreshButton->SetName(_T("RefreshButton"));
1001 >    itemBoxSizer6->Add(RefreshButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
1002 >
1003 >    wxArrayString Mods_CheckboxListStrings;
1004 >    Mods_CheckboxList = new wxCheckListBox( itemPanel4, Mods_CheckboxList1, wxDefaultPosition, wxDefaultSize, Mods_CheckboxListStrings, wxLB_HSCROLL );
1005 >    Mods_CheckboxList->SetName(_T("Mods_CheckboxList"));
1006 >    itemBoxSizer5->Add(Mods_CheckboxList, 1, wxGROW|wxALL, 0);
1007 >
1008 >    wxPanel* itemPanel10 = new wxPanel( MainSplitter, DescriptionHolder_Panel, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1009 >    itemPanel10->SetName(_T("DescriptionHolder_Panel"));
1010 >    wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL);
1011 >    itemPanel10->SetSizer(itemBoxSizer11);
1012 >
1013 >    wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
1014 >    itemBoxSizer11->Add(itemBoxSizer12, 0, wxGROW|wxALL, 0);
1015 >    wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL);
1016 >    itemBoxSizer12->Add(itemBoxSizer13, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0);
1017 >    titleText = new wxTextCtrl( itemPanel10, Title_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
1018 >    titleText->SetName(_T("Title_Text"));
1019 >    titleText->SetBackgroundColour(wxColour(240, 240, 240));
1020 >    itemBoxSizer13->Add(titleText, 1, wxGROW|wxLEFT, 5);
1021 >
1022 >    wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxVERTICAL);
1023 >    itemBoxSizer12->Add(itemBoxSizer15, 1, wxGROW|wxALL, 0);
1024 >    creatorText = new wxTextCtrl( itemPanel10, Author_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_RIGHT );
1025 >    creatorText->SetName(_T("Author_Text"));
1026 >    creatorText->SetBackgroundColour(wxColour(240, 240, 240));
1027 >    itemBoxSizer15->Add(creatorText, 1, wxGROW|wxRIGHT, 5);
1028 >
1029 >    wxStaticLine* itemStaticLine17 = new wxStaticLine( itemPanel10, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
1030 >    itemStaticLine17->Show(false);
1031 >    itemBoxSizer11->Add(itemStaticLine17, 0, wxGROW|wxALL, 5);
1032 >
1033 >    descriptionText = new wxTextCtrl( itemPanel10, Description_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH|wxTE_RICH2 );
1034 >    descriptionText->SetName(_T("DescriptionName"));
1035 >    descriptionText->SetBackgroundColour(wxColour(240, 240, 240));
1036 >    itemBoxSizer11->Add(descriptionText, 1, wxGROW|wxLEFT|wxRIGHT, 5);
1037 >
1038 >    MainSplitter->SplitVertically(itemPanel4, itemPanel10, 200);
1039 >    itemBoxSizer2->Add(MainSplitter, 1, wxGROW|wxALL, 0);
1040 >
1041 >    StatusArea = new wxStatusBar( itemFrame1, ID_STATUSBAR, 0 );
1042 >    StatusArea->SetName(_T("StatusArea"));
1043 >    StatusArea->SetFieldsCount(1);
1044 >    StatusArea->SetStatusText(_("AE Installer v1.0"), 0);
1045 >    itemBoxSizer2->Add(StatusArea, 0, wxGROW|wxALL, 0);
1046 >
1047 >    wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL);
1048 >    itemBoxSizer2->Add(itemBoxSizer20, 0, wxGROW|wxALL, 0);
1049 >
1050 >    ProgressBar = new wxGauge( itemFrame1, ProgressBar_Gauge, 1000, wxDefaultPosition, wxDefaultSize, wxGA_SMOOTH );
1051 >    ProgressBar->SetValue(0);
1052 >    itemBoxSizer20->Add(ProgressBar, 1, wxGROW|wxALL, 0);
1053 >
1054 >    InstallButton = new wxButton( itemFrame1, Install_Button, _("Install!"), wxDefaultPosition, wxDefaultSize, 0 );
1055 >    itemBoxSizer20->Add(InstallButton, 0, wxGROW|wxALL, 0);
1056 >
1057 >    wxBoxSizer* itemBoxSizer23 = new wxBoxSizer(wxVERTICAL);
1058 >    itemBoxSizer2->Add(itemBoxSizer23, 0, wxGROW|wxALL, 0);
1059 >
1060 >    OptionsPanel = new wxPanel( itemFrame1, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1061 >    itemBoxSizer2->Add(OptionsPanel, 0, wxGROW, 0);
1062 >
1063 >    wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxHORIZONTAL);
1064 >    OptionsPanel->SetSizer(itemBoxSizer25);
1065 >
1066 >    wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxVERTICAL);
1067 >    itemBoxSizer25->Add(itemBoxSizer26, 0, wxGROW|wxALL, 5);
1068 >
1069 >    SepRadio = new wxRadioButton( OptionsPanel, Sep_RadioButton, _("Sep"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1070 >    SepRadio->SetValue(false);
1071 >    if (MainWindow::ShowToolTips())
1072 >        SepRadio->SetToolTip(_("For PC Demo and Mac"));
1073 >    itemBoxSizer26->Add(SepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1074 >
1075 >    NoSepRadio = new wxRadioButton( OptionsPanel, NoSep_RadioButton, _("NoSep"), wxDefaultPosition, wxDefaultSize, 0 );
1076 >    NoSepRadio->SetValue(false);
1077 >    if (MainWindow::ShowToolTips())
1078 >        NoSepRadio->SetToolTip(_("For PC Retail"));
1079 >    itemBoxSizer26->Add(NoSepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1080 >
1081 >    wxStaticLine* itemStaticLine29 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1082 >    itemBoxSizer25->Add(itemStaticLine29, 0, wxGROW|wxALL, 5);
1083 >
1084 >    wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxVERTICAL);
1085 >    itemBoxSizer25->Add(itemBoxSizer30, 0, wxGROW|wxALL, 5);
1086 >
1087 >    SeperatedRadio = new wxRadioButton( OptionsPanel, Seperated_RadioButton, _("Separated Level0"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1088 >    SeperatedRadio->SetValue(false);
1089 >    SeperatedRadio->SetName(_T("Seperated_RadioButton"));
1090 >    itemBoxSizer30->Add(SeperatedRadio, 0, wxALIGN_LEFT|wxALL, 5);
1091 >
1092 >    CompleteRadio = new wxRadioButton( OptionsPanel, Complete_RadioButton, _("Complete Level0"), wxDefaultPosition, wxDefaultSize, 0 );
1093 >    CompleteRadio->SetValue(false);
1094 >    CompleteRadio->SetName(_T("Complete_RadioButton"));
1095 >    itemBoxSizer30->Add(CompleteRadio, 0, wxALIGN_LEFT|wxALL, 5);
1096 >
1097 >    wxStaticLine* itemStaticLine33 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1098 >    itemBoxSizer25->Add(itemStaticLine33, 0, wxGROW|wxALL, 5);
1099 >
1100 >    wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxVERTICAL);
1101 >    itemBoxSizer25->Add(itemBoxSizer34, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1102 >
1103 >    ReglobalizeButton = new wxButton( OptionsPanel, ReGlobalize_Button, _("Reglobalize"), wxDefaultPosition, wxDefaultSize, 0 );
1104 >    ReglobalizeButton->SetName(_T("Reglobalize_Button"));
1105 >    itemBoxSizer34->Add(ReglobalizeButton, 0, wxGROW|wxALL, 5);
1106  
1107 <        // Connect events and objects
1108 <        Mods_CheckboxList->Connect(Mods_CheckboxList1, wxEVT_CREATE, wxWindowCreateEventHandler(MainWindow::ModList_OnCreate), NULL, this);
1107 >    // Connect events and objects
1108 >    Mods_CheckboxList->Connect(Mods_CheckboxList1, wxEVT_CREATE, wxWindowCreateEventHandler(MainWindow::ModList_OnCreate), NULL, this);
1109          ////@end MainWindow content construction
1110  
1111          if ( exists( "../../GameDataFolder/level0_Final.sep" ) ) {
1112 <                static_cast<string>("-import:sep");
1112 >                strImportOption = "-import:sep";
1113                  splitInstances = NOT_SPLIT;
1114          }
1115          else {
1116 <                static_cast<string>("-import:nosep");
1116 >                strImportOption = "-import:nosep";
1117                  splitInstances = SPLIT;
1118          }
1119  
# Line 1108 | Line 1128 | void MainWindow::CreateControls()
1128          TheInstallButton = InstallButton;
1129          TheProgressBar = ProgressBar;
1130          OptionsPanel->Hide();
1131 <        if(splitInstances == SPLIT) SeparatedRadio->SetValue(true);
1131 >        if(splitInstances == SPLIT) SeperatedRadio->SetValue(true);
1132          else CompleteRadio->SetValue(true);
1133  
1134  
1135  
1136          if(strImportOption == "-import:nosep") NoSepRadio->SetValue(true);
1137          else SepRadio->SetValue(true);
1138 <        
1139 <        
1138 >
1139 >
1140   #ifdef WIN32
1141          RedirectIOToConsole();
1142          HWND hWnd = GetConsoleWindow();
1143          ShowWindow( hWnd, SW_HIDE );
1144   #endif
1145 <        
1146 <                //MainWindow::SetSize(MainWindow::GetRect().GetWidth(), MainWindow::GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight() );
1145 >
1146 >        //MainWindow::SetSize(MainWindow::GetRect().GetWidth(), MainWindow::GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight() );
1147   }
1148  
1149  
# Line 1180 | Line 1200 | wxBitmap MainWindow::GetBitmapResource(
1200   {
1201          // Bitmap retrieval
1202          ////@begin MainWindow bitmap retrieval
1203 <        wxUnusedVar(name);
1204 <        if (name == _T("redo.xpm"))
1205 <        {
1206 <                wxBitmap bitmap(redo_xpm);
1207 <                return bitmap;
1208 <        }
1209 <        else if (name == _T("fileopen.xpm"))
1210 <        {
1211 <                wxBitmap bitmap( fileopen_xpm);
1212 <                return bitmap;
1213 <        }
1214 <        else if (name == _T("filesaveas.xpm"))
1215 <        {
1216 <                wxBitmap bitmap( filesaveas_xpm);
1217 <                return bitmap;
1218 <        }
1219 <        else if (name == _T("quit.xpm"))
1220 <        {
1221 <                wxBitmap bitmap( quit_xpm);
1222 <                return bitmap;
1223 <        }
1224 <        return wxNullBitmap;
1203 >    wxUnusedVar(name);
1204 >    if (name == _T("undo.xpm"))
1205 >    {
1206 >        wxBitmap bitmap( undo_xpm);
1207 >        return bitmap;
1208 >    }
1209 >    else if (name == _T("fileopen.xpm"))
1210 >    {
1211 >        wxBitmap bitmap( fileopen_xpm);
1212 >        return bitmap;
1213 >    }
1214 >    else if (name == _T("filesaveas.xpm"))
1215 >    {
1216 >        wxBitmap bitmap( filesaveas_xpm);
1217 >        return bitmap;
1218 >    }
1219 >    else if (name == _T("quit.xpm"))
1220 >    {
1221 >        wxBitmap bitmap( quit_xpm);
1222 >        return bitmap;
1223 >    }
1224 >    return wxNullBitmap;
1225          ////@end MainWindow bitmap retrieval
1226   }
1227  
# Line 1214 | Line 1234 | wxIcon MainWindow::GetIconResource( cons
1234  
1235          // Icon retrieval
1236          ////@begin MainWindow icon retrieval
1237 <        wxUnusedVar(name);
1238 <        if (name == _T("oni_special.ico"))
1239 <        {
1240 <        //      wxIcon icon(_T("oni_special.ico"), wxBITMAP_TYPE_ICO);
1241 <        //      return icon;
1242 <        }
1243 <        return wxNullIcon;
1237 >    wxUnusedVar(name);
1238 >    if (name == _T("aelogosmall.png"))
1239 >    {
1240 >        wxIcon icon(aelogosmall_xpm);
1241 >        return icon;
1242 >    }
1243 >    return wxNullIcon;
1244          ////@end MainWindow icon retrieval
1245   }
1246  
# Line 1268 | Line 1288 | void MainWindow::OnModsCheckboxList1Togg
1288  
1289   void MainWindow::OnOptionsClick( wxCommandEvent& event )
1290   {
1271
1272
1273        
1274
1291          if (!event.GetInt() ) {
1292                  OptionsPanel->Hide();
1293 <                MainWindow::SetSize(MainWindow::GetRect().GetWidth(), MainWindow::GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight());}
1293 >                
1294 >                this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight());}
1295          else {
1296 <                //Uncomment this when we release, it gets annoying if you are testing globalization a lot ;)
1297 <                //wxMessageDialog* YesNoDialog = new wxMessageDialog(this,                      "WARNING: These options are for advanced users only, use with caution.", "AE Installer Alert",  wxOK | wxICON_EXCLAMATION       , wxDefaultPosition);
1298 <                //YesNoDialog->ShowModal();
1296 > //              Uncomment this when we release, it gets annoying if you are testing globalization a lot ;)
1297 >                wxMessageDialog* YesNoDialog = new wxMessageDialog(this,                        "WARNING: These options are for advanced users only, use with caution.",
1298 >                                                                                                                   "AE Installer Alert",  wxOK | wxICON_EXCLAMATION     , wxDefaultPosition);
1299 >                YesNoDialog->ShowModal();
1300                  OptionsPanel->Show();
1301 <                MainWindow::SetSize(MainWindow::GetRect().GetWidth(), MainWindow::GetRect().GetHeight()+OptionsPanel->GetRect().GetHeight());
1301 >                this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()+OptionsPanel->GetRect().GetHeight()+1);
1302 >                this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()-1);
1303          }
1304   }
1305  
# Line 1320 | Line 1339 | void MainWindow::OnInstallButtonClick( w
1339          localPackages.push_back("Globalize");
1340          for(int i = 0; i < globalPackages.size(); i++) if(Mods_CheckboxList->IsChecked(i)) localPackages.push_back( globalPackages[i].modStringName );
1341          if ( !localPackages.empty() )   {
1342 <
1342 >        
1343                  //MainWindow::MainWindow().Hide();      
1344                  //      boost::thread thrd2(recompileAll(localPackages) );
1345                  //MainWindow::MainWindow().Show();
1346 +                this->InstallButton->Disable();
1347 +                this->ReglobalizeButton->Disable();
1348   #ifdef WIN32
1349                  recompile packages(localPackages);
1350                  boost::thread thrd(packages);
1351   #else
1331                this->Disable();
1352                  recompileAll(localPackages);
1333                this->Enable();
1353   #endif
1354  
1355 +                this->InstallButton->Enable();
1356 +                this->ReglobalizeButton->Enable();
1357          }
1358  
1359  
# Line 1365 | Line 1386 | void setProgressBar( int i ) {
1386   void MainWindow::OnStatusbarUpdate( wxUpdateUIEvent& event )
1387   {
1388          ////@begin wxEVT_UPDATE_UI event handler for ID_STATUSBAR in MainWindow.
1389 <        // Before editing this code, remove the block markers.
1390 <        event.Skip();
1389 >    // Before editing this code, remove the block markers.
1390 >    event.Skip();
1391          ////@end wxEVT_UPDATE_UI event handler for ID_STATUSBAR in MainWindow.
1392   }
1393  
# Line 1378 | Line 1399 | void MainWindow::OnStatusbarUpdate( wxUp
1399   void MainWindow::OnAboutClick( wxCommandEvent& event )
1400   {
1401          ////@begin wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow.
1402 <        // Before editing this code, remove the block markers.
1403 <        About* window = new About(this);
1404 <        int returnValue = window->ShowModal();
1405 <        window->Destroy();
1402 >    // Before editing this code, remove the block markers.
1403 >    About* window = new About(this);
1404 >    int returnValue = window->ShowModal();
1405 >    window->Destroy();
1406          ////@end wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow.
1407   }
1408  
# Line 1410 | Line 1431 | void MainWindow::OnSepRadioButtonSelecte
1431   * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton
1432   */
1433  
1413 void MainWindow::OnSeparatedRadioButtonSelected( wxCommandEvent& event )
1414 {
1415        splitInstances = SPLIT;
1416
1417 }
1418
1419
1434   /*
1435   * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Complete_RadioButton
1436   */
# Line 1459 | Line 1473 | void MainWindow::refreshMods (vector<str
1473  
1474   void MainWindow::OnLoadClick( wxCommandEvent& event )
1475   {
1476 +        if (busy == 1) return;
1477          static const wxChar *FILETYPES = _T(
1478                  "Mod Loadouts (*.cfg)|*.cfg|"
1479                  "All files (*.*)|*.*"
# Line 1483 | Line 1498 | void MainWindow::OnLoadClick( wxCommandE
1498  
1499   void MainWindow::OnSaveClick( wxCommandEvent& event )
1500   {
1501 +        if (busy == 1) return;
1502          static const wxChar *FILETYPES = _T(
1503                  "Mod Loadouts (*.cfg)|*.cfg|"
1504                  "All files (*.*)|*.*"
# Line 1538 | Line 1554 | void MainWindow::OnSaveClick( wxCommandE
1554  
1555   void MainWindow::OnReGlobalizeButtonClick( wxCommandEvent& event )
1556   {
1557 <        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);
1557 >        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);
1558  
1559          if (YesNoDialog->ShowModal() == wxID_NO) { //if the user said no...
1560 <                
1560 >
1561          }
1562          else {
1547                
1563          
1564 +                this->InstallButton->Disable();
1565 +                this->ReglobalizeButton->Disable();
1566  
1567   #ifdef WIN32
1568  
1569 <        boost::thread thrd2(globalizeData);
1570 <        //globalizeData();
1571 <        //boost::thread::create_thread(&globalizeData);
1572 <        //       boost::thread_group Tg;
1573 <        // Tg.create_thread( &globalizeData(), this );
1569 >                boost::thread thrd2(globalizeData);
1570 >                //globalizeData();
1571 >                //boost::thread::create_thread(&globalizeData);
1572 >                //       boost::thread_group Tg;
1573 >                // Tg.create_thread( &globalizeData(), this );
1574   #else
1575 <        globalizeData();
1559 <        setProgressBar(1000);
1560 <        setStatusArea("Done!");
1575 >                globalizeData();
1576   #endif
1577 < }
1577 >                
1578 >                this->InstallButton->Enable();
1579 >                this->ReglobalizeButton->Enable();
1580 >        }
1581  
1582   }
1583   /*
# Line 1574 | Line 1592 | event.Skip();
1592   ////@end wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton in MainWindow.
1593   }*/
1594  
1595 +
1596 + /*
1597 + * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Seperated_RadioButton
1598 + */
1599 +
1600 + void MainWindow::OnSeperatedRadioButtonSelected( wxCommandEvent& event )
1601 + {
1602 + splitInstances = SPLIT;
1603 + }
1604 +

Diff Legend

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