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 390 by gumby, Mon Jul 6 14:02:56 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" );
150                
151                  create_directory( "packages/VanillaDats/level0_Final/" );
152                  //blah blah finish this.
153                  //logfile <<  "packages/VanillaDats/level0_Final/ created";
# Line 162 | Line 162 | int globalizeData(void)
162                  int num_levels = 0;
163                  for(int i = 1; i < 15; i++)
164                  {
165 <                                if (exists("../../GameDataFolder/level" + levels[i] + "_Final.dat")) {
165 >                        if (exists("../../GameDataFolder/level" + levels[i] + "_Final.dat")) {
166                                  num_levels++;
167  
168                          }
# Line 171 | Line 171 | int globalizeData(void)
171                  int total_steps =  8 + 2 * num_levels;
172                  for(int i = 0; i < 15; i++)
173                  {
174 <                        
174 >
175                          //printf(levels[i],"%d",levels[i]); // int to char array
176 <                        
176 >
177                          if (exists("../../GameDataFolder/level" + levels[i] + "_Final.dat")) {
178                                  logfile << "level" << levels[i] << "_Final\n";
179                                  logfile << "\tExporting level" << levels[i] << "_Final.dat\n";
180                                  //printf(Step_x_x,"Step %d/%d: exporting level%d_final.dat", parts_done + 1,, levels[i]); setStatusArea((string)Step_x_x);
181                                  setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + " exporting level" + levels[i]+"_Final.dat");
182                                  create_directory( "../GameDataFolder/level" + levels[i] + "_Final" );
183 < //                              setStatusArea(strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat");
183 >                                //                              setStatusArea(strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat");
184                                  system((strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat").c_str());
185                                  create_directory( "packages/VanillaDats/level" + levels[i] + "_Final" );
186                                  create_directory( "packages/VanillaDats/level" + levels[i] + "_Final/level" + levels[i] + "_Final" );
# Line 256 | Line 256 | int globalizeData(void)
256                                                  else if (dir_itr->path().filename().substr(0,4) == "AGDB"
257                                                          || dir_itr->path().filename().substr(0,4) == "TRCM") {
258                                                                  cout <<dir_itr->path().filename() << "\n";
259 <                                        
259 >
260                                                                  if(!exists( Archive / dir_itr->filename())) rename(dir_itr->path(), Archive / dir_itr->filename());
261                                                                  else remove(dir_itr->path());
262                                                  }
263 +                                                else if (dir_itr->path().filename().substr(0,4) == "ONWC") { //fix for buggy ONWC overriding
264 +                                                                cout <<dir_itr->path().filename() << "\n";
265 +
266 +                                                                if(!exists( "packages/VanillaDats/level" + levels[i] + "_Final/level" + levels[i] + "_Final/" +  dir_itr->filename())) rename(dir_itr->path(), "packages/VanillaDats/level" + levels[i] + "_Final/level" + levels[i] + "_Final/" +  dir_itr->filename());
267 +                                                                else remove(dir_itr->path());
268 +                                                }
269                                                  if (exists(dir_itr->path())) {
270  
271                                                  }
272                                                  else {
273 <                                                        logfile << "\tMoved file: " << dir_itr->path().filename() << "\n";
273 >                                                        //logfile << "\tMoved file: " << dir_itr->path().filename() << "\n";
274                                                  }
275                                          }
276  
277  
278 <                                                
278 >
279                                  }
280                                  logfile << "\tCleaning up TXMPs...\n";
281                                  system( (strOniSplit + " -move:delete " + Textures.string() + " ../GameDataFolder/level" + levels[i] + "_Final/TXMP*.oni").c_str());
282                                  parts_done++;
283  
284                                  setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) ));
285 <                                
285 >
286                          }
287                  }
288                  logfile << "Reimporting levels\n";
# Line 286 | Line 292 | int globalizeData(void)
292                          //printf(levels[i],"%d",levels[i]);
293                          //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");
294                          setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + " reimporting level" + levels[i]+"_Final.oni");
295 <                        system( (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level"
296 <                                + levels[i] + "_Final/level" + levels[i] + "_Final.oni > Globalize.oni").c_str());
295 >                        logfile << (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level"
296 >                                + levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize.log").c_str() << '\n';
297 >                        string sys_str = (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level"
298 >                                + levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize2.log");
299 >                                system(sys_str.c_str() );
300                          setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) ));
301 <                                parts_done++;
301 >                        parts_done++;
302                  }
303                  create_directory( VanillaCharacters.parent_path() );
304                  create_directory( VanillaParticles.parent_path() );
305                  create_directory( VanillaTextures.parent_path() );
306                  create_directory( VanillaSounds.parent_path() );
307                  create_directory( VanillaAnimations.remove_filename() );
308 <                
308 >
309                  for(int j = 0; j < GDFPaths.size(); j++) {
310                          logfile << "\tReimporting " << GDFPaths[j].filename() << ".oni\n";
311 <                        setStatusArea("Step" + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + ": reimporting " + GDFPaths[j].filename() );
311 >                        setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + ": reimporting " + GDFPaths[j].filename() );
312                          system((strOniSplit + " " + strImportOption + " " + GDFPaths[j].string() + " " + VanillaPaths[j].string()).c_str());
313                          parts_done++;
314                          setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) ));
315                  }
316 < /*
316 >                /*
317                  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) ));
318                  system((strOniSplit + " " + strImportOption + " " + Characters.string() + " " + VanillaCharacters.string()).c_str());
319                  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 329 | int globalizeData(void)
329                  system((strOniSplit + " " + strImportOption + " " + TRAM.string() + " " + VanillaTRAM.string()).c_str());
330                  //parts_done++; setStatusArea((string)"Copying level scripts...");setProgressBar( (int)(1000 * (float)(parts_done) / (float)(7 + 2 * num_levels) ));
331                  if (exists("../GameDataFolder/IGMD")) remove_all("../GameDataFolder/IGMD");
332 < */
332 >                */
333                  create_directory((path)"../GameDataFolder/IGMD");
334 <                copy((path)"packages/VanillaBSL/", (path)"../GameDataFolder");
335 <                setProgressBar( 1000 );
327 <                setStatusArea((string)"Done! Now select your mod packages and click install.");
328 <        //      while(1) Sleep(-1);
334 >                copy((path)"packages/VanillaBSL/IGMD", (path)"../GameDataFolder");
335 >                setProgressBar( 1000 );
336                  
337 +                // 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/
338 +                // or we could just include it in the zip in the proper place already.
339 +
340 +                copy("../../persist.dat","../persist.dat");
341 +                copy("../../keyconfig.txt","../keyconfig.txt");
342 + #ifndef WIN32
343 +                /* 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).
344 +                   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,
345 +                   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 */
346 +                path fullAEpath = system_complete("."); // get full path for Installer
347 +                char prefsCommand[300] = "defaults write com.godgames.oni RetailInstallationPath -string '";
348 +                strcat(prefsCommand, fullAEpath.parent_path().parent_path().string().c_str()); // get path of edition/ folder (Oni wants the folder that *contains* the GDF)
349 +                strcat(prefsCommand, "'"); // path string is enclosed in single quotes to avoid the need to escape UNIX-unfriendly characters
350 +                system(prefsCommand);
351 +                
352 + #endif
353 +                
354 +                
355 +                setStatusArea((string)"Done! Now select your mod packages and click install.");
356 +                //      while(1) Sleep(-1);
357 +
358          }
359          catch (exception ex) {
360                  setStatusArea("Warning, handled exception: " + (string)ex.what());
361          }
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();
362  
363 +        ptime end_time(second_clock::local_time());
364 +        time_period total_time (start_time, end_time);
365 +        logfile << "\n\nGlobalization ended " << to_simple_string(end_time) << "\nThe process took " << total_time.length();
366 +        //total_time.length().hours();
367 +        logfile.close();
368 +        busy = 0;
369          return err;
370   }
371  
# Line 490 | Line 518 | ModPackage fileToModPackage(fstream &fil
518  
519   void recompileAll(vector<string> installedMods)
520   {
521 +        busy = 1;
522          using namespace boost::gregorian;
523          using namespace boost::posix_time;
524 +        using boost::lexical_cast;
525 +        using boost::bad_lexical_cast;
526          
527          setStatusArea("Importing levels...");
528          //setStatusArea("Recompiling Data...");
# Line 550 | Line 581 | void recompileAll(vector<string> install
581                                                  }
582                                                  importCommand += " ../GameDataFolder/" + dir_itr->path().filename() + ".dat >> Install.log";
583  
584 <                                                printf(statusString,"%d/%i\0",j,numberOfDats);  
584 >                                                
585                                                  setProgressBar( (int)(1000 * (float)(j-1) / (float)numberOfDats) ); //100% * dat we're on / total dats
586 <                                                setStatusArea("Importing " +  dir_itr->path().filename() + " " + statusString);
586 >                                                setStatusArea("Step " + lexical_cast<std::string>(j) + '/' + lexical_cast<std::string>(numberOfDats)+ ": Importing " +  dir_itr->path().filename() + " ");
587  
588                                                  system(importCommand.c_str());
589                                                  //Sleep(1000);
# Line 563 | Line 594 | void recompileAll(vector<string> install
594                                  }
595                                  catch ( const std::exception & ex )
596                                  {
597 <                                        
598 <        remove("Install.log");
599 <        ofstream logfile("Install.log");
600 <        
601 <        
597 >
598 >                                        remove("Install.log");
599 >                                        ofstream logfile("Install.log");
600 >
601 >
602                                          logfile << "Warning, exception " << ex.what() << "!";
603                                          setStatusArea("Warning, exception " + (string)ex.what() + "!");
604 < logfile.close();        
604 >                                        logfile.close();        
605                                  }
606                          }
607  
608                  }
609                  catch( const std::exception & ex ) {
610 <        
611 <        remove("Install.log");
612 <        ofstream logfile("Install.log");
613 <        
614 <        
615 <                                        logfile << "Warning, exception " << ex.what() << "!";
616 <                                        setStatusArea("Warning, exception " + (string)ex.what() + "!");
617 < logfile.close();
610 >
611 >                        remove("Install.log");
612 >                        ofstream logfile("Install.log");
613 >
614 >
615 >                        logfile << "Warning, exception " << ex.what() << "!";
616 >                        setStatusArea("Warning, exception " + (string)ex.what() + "!");
617 >                        logfile.close();
618                  }
619  
620          }
# Line 614 | Line 645 | logfile.close();
645                          {
646                                  if ( is_directory( dir_itr->status() ) )
647                                  {
648 <                                        importCommand = strOniSplit + " " + strImportOption + " " + vanilla_dir.string() + dir_itr->path().filename() + " " + "../GameDataFolder/" + dir_itr->path().filename()
618 <                                                + ".dat";
648 >                                        importCommand = strOniSplit + " " + strImportOption + " " + vanilla_dir.string() + dir_itr->path().filename() + " ";
649                                          for (int i = 0; i < installedMods.size(); ++i) {
650                                                  if (exists("packages/" + installedMods[i] + "/oni/" + dir_itr->path().filename()  ))
651                                                          importCommand += " packages/" + installedMods[i] + "/oni/" + dir_itr->path().filename();
652                                          }
653                                          importCommand += " ../GameDataFolder/" + dir_itr->path().filename() + ".dat >> Install.log";
654  
655 <                                        printf(statusString,"%d/%i\0",j,numberOfDats);  
655 >
656                                          setProgressBar( (int)(1000 * (float)(j-1) / (float)numberOfDats) ); //100% * dat we're on / total dats
657 <                                        setStatusArea("Importing " +  dir_itr->path().filename() + " " + statusString);
657 >                                        setStatusArea("Step " + lexical_cast<std::string>(j) + '/' + lexical_cast<std::string>(numberOfDats)+ ": Importing " +  dir_itr->path().filename() + " ");
658  
659                                          system(importCommand.c_str());
660  
# Line 633 | Line 663 | logfile.close();
663                          }
664                          catch ( const std::exception & ex )
665                          {
666 <        
667 <        remove("Install.log");
668 <        ofstream logfile("Install.log");
669 <        
670 <        
671 <                                        logfile << "Warning, exception " << ex.what() << "!";
672 <                                        setStatusArea("Warning, exception " + (string)ex.what() + "!");
673 < logfile.close();
666 >
667 >                                remove("Install.log");
668 >                                ofstream logfile("Install.log");
669 >
670 >
671 >                                logfile << "Warning, exception " << ex.what() << "!";
672 >                                setStatusArea("Warning, exception " + (string)ex.what() + "!");
673 >                                logfile.close();
674                          }}
675          }
676          logfile << "Writing config file";
677          writeInstalledMods(installedMods);
678          setProgressBar(1000);
679          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();
680  
681 <                //total_time.length().hours();
682 <        
681 >        ptime end_time(second_clock::local_time());
682 >        time_period total_time (start_time, end_time);
683 >
684 >
685 >        ofstream logfile2("Install.log", ios::app | ios::ate);
686 >        string outstring = (string)"\n\nGlobalization ended " + to_simple_string(end_time) + "\nThe process took ";// + (string)total_time.length();
687 >
688 >        logfile2 << "\nGlobalization ended " << to_simple_string(end_time) << "\nThe process took " << total_time.length();
689 >
690 >        //logfile2.write(outstring.c_str(), outstring.length());
691 >        logfile2.close();
692 >
693 >        //total_time.length().hours();
694 >
695          Sleep(1000);
696          setProgressBar(0);
697 +        busy = 0;
698   }
699  
700   void writeInstalledMods(vector<string> installedMods)
# Line 775 | Line 806 | vector<ModPackage> globalPackages;
806   #endif
807  
808   ////@begin includes
809 < #include "about_window.h"
809 > #include "about.h"
810   ////@end includes
811  
812   #include "main_window.h"
813  
814   ////@begin XPM images
815 < #include "redo.xpm"
815 > #include "aelogosmall.xpm"
816 > #include "undo.xpm"
817   #include "fileopen.xpm"
818   #include "filesaveas.xpm"
819   #include "quit.xpm"
# Line 804 | Line 836 | IMPLEMENT_CLASS( MainWindow, wxFrame )
836   BEGIN_EVENT_TABLE( MainWindow, wxFrame )
837  
838   ////@begin MainWindow event table entries
839 < EVT_CHECKBOX( SelectAll_Checkbox, MainWindow::OnSelectAllCheckboxClick )
839 >    EVT_CHECKBOX( SelectAll_Checkbox, MainWindow::OnSelectAllCheckboxClick )
840  
841 < EVT_BUTTON( Refresh_Button, MainWindow::OnRefreshButtonClick )
841 >    EVT_BUTTON( Refresh_Button, MainWindow::OnRefreshButtonClick )
842  
843 < EVT_LISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Selected )
844 < EVT_CHECKLISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Toggled )
843 >    EVT_LISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Selected )
844 >    EVT_CHECKLISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Toggled )
845  
846 < EVT_UPDATE_UI( ID_STATUSBAR, MainWindow::OnStatusbarUpdate )
846 >    EVT_UPDATE_UI( ID_STATUSBAR, MainWindow::OnStatusbarUpdate )
847  
848 < EVT_BUTTON( Install_Button, MainWindow::OnInstallButtonClick )
848 >    EVT_BUTTON( Install_Button, MainWindow::OnInstallButtonClick )
849  
850 < EVT_RADIOBUTTON( Sep_RadioButton, MainWindow::OnSepRadioButtonSelected )
850 >    EVT_RADIOBUTTON( Sep_RadioButton, MainWindow::OnSepRadioButtonSelected )
851  
852 < EVT_RADIOBUTTON( NoSep_RadioButton, MainWindow::OnNoSepRadioButtonSelected )
852 >    EVT_RADIOBUTTON( NoSep_RadioButton, MainWindow::OnNoSepRadioButtonSelected )
853  
854 < EVT_RADIOBUTTON( Separated_RadioButton, MainWindow::OnSeparatedRadioButtonSelected )
854 >    EVT_RADIOBUTTON( Seperated_RadioButton, MainWindow::OnSeperatedRadioButtonSelected )
855  
856 < EVT_RADIOBUTTON( Complete_RadioButton, MainWindow::OnCompleteRadioButtonSelected )
856 >    EVT_RADIOBUTTON( Complete_RadioButton, MainWindow::OnCompleteRadioButtonSelected )
857  
858 < EVT_BUTTON( ReGlobalize_Button, MainWindow::OnReGlobalizeButtonClick )
858 >    EVT_BUTTON( ReGlobalize_Button, MainWindow::OnReGlobalizeButtonClick )
859  
860 < EVT_MENU( wxID_LOAD, MainWindow::OnLoadClick )
860 >    EVT_MENU( wxID_LOAD, MainWindow::OnLoadClick )
861  
862 < EVT_MENU( wxID_SAVE, MainWindow::OnSaveClick )
862 >    EVT_MENU( wxID_SAVE, MainWindow::OnSaveClick )
863  
864 < EVT_MENU( wxID_EXIT, MainWindow::OnExitClick )
864 >    EVT_MENU( wxID_EXIT, MainWindow::OnExitClick )
865  
866 < EVT_MENU( wxID_OPTIONS, MainWindow::OnOptionsClick )
866 >    EVT_MENU( wxID_OPTIONS, MainWindow::OnOptionsClick )
867  
868 < EVT_MENU( wxID_ABOUT, MainWindow::OnAboutClick )
868 >    EVT_MENU( wxID_ABOUT, MainWindow::OnAboutClick )
869  
870   ////@end MainWindow event table entries
871  
# Line 863 | Line 895 | MainWindow::MainWindow( wxWindow* parent
895   bool MainWindow::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
896   {
897          ////@begin MainWindow creation
898 <        wxFrame::Create( parent, id, caption, pos, size, style );
898 >    wxFrame::Create( parent, id, caption, pos, size, style );
899  
900 <        CreateControls();
901 <        SetIcon(GetIconResource(wxT("oni_special.ico")));
902 <        Centre();
871 <        
872 <        
900 >    CreateControls();
901 >    SetIcon(GetIconResource(wxT("aelogosmall.png")));
902 >    Centre();
903          ////@end MainWindow creation
904          return true;
905   }
# Line 893 | Line 923 | MainWindow::~MainWindow()
923   void MainWindow::Init()
924   {
925          ////@begin MainWindow member initialisation
926 <        MainSplitter = NULL;
927 <        SelectAll = NULL;
928 <        RefreshButton = NULL;
929 <        Mods_CheckboxList = NULL;
930 <        titleText = NULL;
931 <        creatorText = NULL;
932 <        descriptionText = NULL;
933 <        StatusArea = NULL;
934 <        ProgressBar = NULL;
935 <        InstallButton = NULL;
936 <        OptionsPanel = NULL;
937 <        SepRadio = NULL;
938 <        NoSepRadio = NULL;
939 <        SeparatedRadio = NULL;
940 <        CompleteRadio = NULL;
941 <        ReglobalizeButton = NULL;
926 >    MainSplitter = NULL;
927 >    SelectAll = NULL;
928 >    RefreshButton = NULL;
929 >    Mods_CheckboxList = NULL;
930 >    titleText = NULL;
931 >    creatorText = NULL;
932 >    descriptionText = NULL;
933 >    StatusArea = NULL;
934 >    ProgressBar = NULL;
935 >    InstallButton = NULL;
936 >    OptionsPanel = NULL;
937 >    SepRadio = NULL;
938 >    NoSepRadio = NULL;
939 >    SeperatedRadio = NULL;
940 >    CompleteRadio = NULL;
941 >    ReglobalizeButton = NULL;
942          ////@end MainWindow member initialisation
943  
944   }
# Line 923 | Line 953 | wxGauge* TheProgressBar;
953   void MainWindow::CreateControls()
954   {    
955          ////@begin MainWindow content construction
956 <        // Generated by DialogBlocks, 31/05/2009 19:03:55 (unregistered)
956 >    MainWindow* itemFrame1 = this;
957  
958 <        MainWindow* itemFrame1 = this;
959 <
960 <        wxMenuBar* menuBar = new wxMenuBar;
961 <        wxMenu* itemMenu37 = new wxMenu;
962 <        {
963 <                wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_LOAD, _("&Load Configuration..."), wxEmptyString, wxITEM_NORMAL);
964 <                wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("fileopen.xpm")));
965 <                menuItem->SetBitmap(bitmap);
966 <                itemMenu37->Append(menuItem);
967 <        }
968 <        {
969 <                wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_SAVE, _("&Save Configuration..."), wxEmptyString, wxITEM_NORMAL);
970 <                wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("filesaveas.xpm")));
971 <                menuItem->SetBitmap(bitmap);
972 <                itemMenu37->Append(menuItem);
973 <        }
974 <        itemMenu37->AppendSeparator();
975 <        {
976 <                wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_EXIT, _("Exit"), wxEmptyString, wxITEM_NORMAL);
977 <                wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("quit.xpm")));
978 <                menuItem->SetBitmap(bitmap);
979 <                itemMenu37->Append(menuItem);
980 <        }
981 <        menuBar->Append(itemMenu37, _("&File"));
982 <        wxMenu* itemMenu42 = new wxMenu;
983 <        itemMenu42->Append(wxID_OPTIONS, _("Show Advanced Options..."), wxEmptyString, wxITEM_CHECK);
984 <        menuBar->Append(itemMenu42, _("Options"));
955 <        wxMenu* itemMenu44 = new wxMenu;
956 <        itemMenu44->Append(wxID_HELP, _("Help"), wxEmptyString, wxITEM_NORMAL);
958 >    wxMenuBar* menuBar = new wxMenuBar;
959 >    wxMenu* itemMenu37 = new wxMenu;
960 >    {
961 >        wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_LOAD, _("&Load Configuration..."), wxEmptyString, wxITEM_NORMAL);
962 >        wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("fileopen.xpm")));
963 >        menuItem->SetBitmap(bitmap);
964 >        itemMenu37->Append(menuItem);
965 >    }
966 >    {
967 >        wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_SAVE, _("&Save Configuration..."), wxEmptyString, wxITEM_NORMAL);
968 >        wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("filesaveas.xpm")));
969 >        menuItem->SetBitmap(bitmap);
970 >        itemMenu37->Append(menuItem);
971 >    }
972 >    itemMenu37->AppendSeparator();
973 >    {
974 >        wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_EXIT, _("Exit"), wxEmptyString, wxITEM_NORMAL);
975 >        wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("quit.xpm")));
976 >        menuItem->SetBitmap(bitmap);
977 >        itemMenu37->Append(menuItem);
978 >    }
979 >    menuBar->Append(itemMenu37, _("&File"));
980 >    wxMenu* itemMenu42 = new wxMenu;
981 >    itemMenu42->Append(wxID_OPTIONS, _("Show Advanced Options..."), wxEmptyString, wxITEM_CHECK);
982 >    menuBar->Append(itemMenu42, _("Options"));
983 >    wxMenu* itemMenu44 = new wxMenu;
984 > #ifdef WIN32
985          itemMenu44->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
986          menuBar->Append(itemMenu44, _("Help"));
987 <        itemFrame1->SetMenuBar(menuBar);
987 > #else
988 >        itemMenu37->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
989 > #endif  
990 >
991 >    itemFrame1->SetMenuBar(menuBar);
992  
993 <        wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
994 <        itemFrame1->SetSizer(itemBoxSizer2);
993 >    wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
994 >    itemFrame1->SetSizer(itemBoxSizer2);
995  
996 <        MainSplitter = new wxSplitterWindow( itemFrame1, ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(100, 100), wxSP_LIVE_UPDATE|wxNO_BORDER );
997 <        MainSplitter->SetMinimumPaneSize(150);
998 <        MainSplitter->SetName(_T("MainSplitter"));
999 <
1000 <        wxPanel* itemPanel4 = new wxPanel( MainSplitter, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1001 <        wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
1002 <        itemPanel4->SetSizer(itemBoxSizer5);
1003 <
1004 <        wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
1005 <        itemBoxSizer5->Add(itemBoxSizer6, 0, wxGROW|wxALL, 0);
1006 <        SelectAll = new wxCheckBox( itemPanel4, SelectAll_Checkbox, _("Select All/None"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE );
1007 <        SelectAll->SetValue(false);
1008 <        SelectAll->SetName(_T("SelectAll_Checkbox"));
1009 <        itemBoxSizer6->Add(SelectAll, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1010 <
1011 <        RefreshButton = new wxBitmapButton( itemPanel4, Refresh_Button, itemFrame1->GetBitmapResource(wxT("redo.xpm")), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
1012 <        RefreshButton->SetName(_T("RefreshButton"));
1013 <        itemBoxSizer6->Add(RefreshButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
1014 <
1015 <        wxArrayString Mods_CheckboxListStrings;
1016 <        Mods_CheckboxList = new wxCheckListBox( itemPanel4, Mods_CheckboxList1, wxDefaultPosition, wxDefaultSize, Mods_CheckboxListStrings, wxLB_HSCROLL );
1017 <        Mods_CheckboxList->SetName(_T("Mods_CheckboxList"));
1018 <        itemBoxSizer5->Add(Mods_CheckboxList, 1, wxGROW|wxALL, 0);
1019 <
1020 <        wxPanel* itemPanel10 = new wxPanel( MainSplitter, DescriptionHolder_Panel, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1021 <        itemPanel10->SetName(_T("DescriptionHolder_Panel"));
1022 <        wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL);
1023 <        itemPanel10->SetSizer(itemBoxSizer11);
1024 <
1025 <        wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
1026 <        itemBoxSizer11->Add(itemBoxSizer12, 0, wxGROW|wxALL, 0);
1027 <        wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL);
1028 <        itemBoxSizer12->Add(itemBoxSizer13, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0);
1029 <        titleText = new wxTextCtrl( itemPanel10, Title_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
1030 <        titleText->SetName(_T("Title_Text"));
1031 <        titleText->SetBackgroundColour(wxColour(240, 240, 240));
1032 <        itemBoxSizer13->Add(titleText, 1, wxGROW|wxLEFT, 5);
1033 <
1034 <        wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxVERTICAL);
1035 <        itemBoxSizer12->Add(itemBoxSizer15, 1, wxGROW|wxALL, 0);
1036 <        creatorText = new wxTextCtrl( itemPanel10, Author_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_RIGHT );
1037 <        creatorText->SetName(_T("Author_Text"));
1038 <        creatorText->SetBackgroundColour(wxColour(240, 240, 240));
1039 <        itemBoxSizer15->Add(creatorText, 1, wxGROW|wxRIGHT, 5);
1040 <
1041 <        wxStaticLine* itemStaticLine17 = new wxStaticLine( itemPanel10, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
1042 <        itemStaticLine17->Show(false);
1043 <        itemBoxSizer11->Add(itemStaticLine17, 0, wxGROW|wxALL, 5);
1044 <
1045 <        descriptionText = new wxTextCtrl( itemPanel10, Description_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH|wxTE_AUTO_URL );
1046 <        descriptionText->SetName(_T("DescriptionName"));
1047 <        descriptionText->SetBackgroundColour(wxColour(240, 240, 240));
1048 <        itemBoxSizer11->Add(descriptionText, 1, wxGROW|wxLEFT|wxRIGHT, 5);
1049 <
1050 <        MainSplitter->SplitVertically(itemPanel4, itemPanel10, 150);
1051 <        itemBoxSizer2->Add(MainSplitter, 1, wxGROW|wxALL, 0);
1052 <
1053 <        StatusArea = new wxStatusBar( itemFrame1, ID_STATUSBAR, 0 );
1054 <        StatusArea->SetName(_T("StatusArea"));
1055 <        StatusArea->SetFieldsCount(1);
1056 <        StatusArea->SetStatusText(_("Status Area"), 0);
1057 <        itemBoxSizer2->Add(StatusArea, 0, wxGROW|wxALL, 0);
1058 <
1059 <        wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL);
1060 <        itemBoxSizer2->Add(itemBoxSizer20, 0, wxGROW|wxALL, 0);
1061 <
1062 <        ProgressBar = new wxGauge( itemFrame1, ProgressBar_Gauge, 1000, wxDefaultPosition, wxSize(-1, 30), wxGA_SMOOTH );
1063 <        ProgressBar->SetValue(0);
1064 <        itemBoxSizer20->Add(ProgressBar, 1, wxGROW|wxALL, 0);
1065 <
1066 <        InstallButton = new wxButton( itemFrame1, Install_Button, _("Install!"), wxDefaultPosition, wxSize(-1, 30), 0 );
1067 <        itemBoxSizer20->Add(InstallButton, 0, wxGROW|wxALL, 0);
1068 <
1069 <        wxBoxSizer* itemBoxSizer23 = new wxBoxSizer(wxVERTICAL);
1070 <        itemBoxSizer2->Add(itemBoxSizer23, 0, wxGROW|wxALL, 0);
1071 <
1072 <        OptionsPanel = new wxPanel( itemFrame1, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1073 <        itemBoxSizer2->Add(OptionsPanel, 0, wxGROW, 0);
1074 <
1075 <        wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxHORIZONTAL);
1076 <        OptionsPanel->SetSizer(itemBoxSizer25);
1077 <
1078 <        wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxVERTICAL);
1079 <        itemBoxSizer25->Add(itemBoxSizer26, 0, wxGROW|wxALL, 5);
1080 <
1081 <        SepRadio = new wxRadioButton( OptionsPanel, Sep_RadioButton, _("Sep"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1082 <        SepRadio->SetValue(false);
1083 <        if (MainWindow::ShowToolTips())
1084 <                SepRadio->SetToolTip(_("For PC Demo and Mac"));
1085 <        itemBoxSizer26->Add(SepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1086 <
1087 <        NoSepRadio = new wxRadioButton( OptionsPanel, NoSep_RadioButton, _("NoSep"), wxDefaultPosition, wxDefaultSize, 0 );
1088 <        NoSepRadio->SetValue(false);
1089 <        if (MainWindow::ShowToolTips())
1090 <                NoSepRadio->SetToolTip(_("For PC Retail"));
1091 <        itemBoxSizer26->Add(NoSepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1092 <
1093 <        wxStaticLine* itemStaticLine29 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1094 <        itemBoxSizer25->Add(itemStaticLine29, 0, wxGROW|wxALL, 5);
1095 <
1096 <        wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxVERTICAL);
1097 <        itemBoxSizer25->Add(itemBoxSizer30, 0, wxGROW|wxALL, 5);
1098 <
1099 <        SeparatedRadio = new wxRadioButton( OptionsPanel, Separated_RadioButton, _("Separated Level0"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1100 <        SeparatedRadio->SetValue(false);
1101 <        SeparatedRadio->SetName(_T("Separated_RadioButton"));
1102 <        itemBoxSizer30->Add(SeparatedRadio, 0, wxALIGN_LEFT|wxALL, 5);
1103 <
1104 <        CompleteRadio = new wxRadioButton( OptionsPanel, Complete_RadioButton, _("Complete Level0"), wxDefaultPosition, wxDefaultSize, 0 );
1105 <        CompleteRadio->SetValue(false);
1106 <        CompleteRadio->SetName(_T("Complete_RadioButton"));
1107 <        itemBoxSizer30->Add(CompleteRadio, 0, wxALIGN_LEFT|wxALL, 5);
1108 <
1109 <        wxStaticLine* itemStaticLine33 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1110 <        itemBoxSizer25->Add(itemStaticLine33, 0, wxGROW|wxALL, 5);
1111 <
1112 <        wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxVERTICAL);
1113 <        itemBoxSizer25->Add(itemBoxSizer34, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1114 <
1115 <        ReglobalizeButton = new wxButton( OptionsPanel, ReGlobalize_Button, _("Reglobalize"), wxDefaultPosition, wxDefaultSize, 0 );
1116 <        ReglobalizeButton->SetName(_T("Reglobalize_Button"));
1117 <        itemBoxSizer34->Add(ReglobalizeButton, 0, wxGROW|wxALL, 5);
996 >    MainSplitter = new wxSplitterWindow( itemFrame1, ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(100, 100), wxSP_LIVE_UPDATE|wxNO_BORDER );
997 >    MainSplitter->SetMinimumPaneSize(1);
998 >    MainSplitter->SetName(_T("MainSplitter"));
999 >
1000 >    wxPanel* itemPanel4 = new wxPanel( MainSplitter, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1001 >    wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
1002 >    itemPanel4->SetSizer(itemBoxSizer5);
1003 >
1004 >    wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
1005 >    itemBoxSizer5->Add(itemBoxSizer6, 0, wxGROW|wxALL, 0);
1006 >    SelectAll = new wxCheckBox( itemPanel4, SelectAll_Checkbox, _("Select All/None"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE );
1007 >    SelectAll->SetValue(false);
1008 >    SelectAll->SetName(_T("SelectAll_Checkbox"));
1009 >    itemBoxSizer6->Add(SelectAll, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1010 >
1011 >    RefreshButton = new wxBitmapButton( itemPanel4, Refresh_Button, itemFrame1->GetBitmapResource(wxT("undo.xpm")), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
1012 >    RefreshButton->SetName(_T("RefreshButton"));
1013 >    itemBoxSizer6->Add(RefreshButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
1014 >
1015 >    wxArrayString Mods_CheckboxListStrings;
1016 >    Mods_CheckboxList = new wxCheckListBox( itemPanel4, Mods_CheckboxList1, wxDefaultPosition, wxDefaultSize, Mods_CheckboxListStrings, wxLB_HSCROLL );
1017 >    Mods_CheckboxList->SetName(_T("Mods_CheckboxList"));
1018 >    itemBoxSizer5->Add(Mods_CheckboxList, 1, wxGROW|wxALL, 0);
1019 >
1020 >    wxPanel* itemPanel10 = new wxPanel( MainSplitter, DescriptionHolder_Panel, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1021 >    itemPanel10->SetName(_T("DescriptionHolder_Panel"));
1022 >    wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL);
1023 >    itemPanel10->SetSizer(itemBoxSizer11);
1024 >
1025 >    wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
1026 >    itemBoxSizer11->Add(itemBoxSizer12, 0, wxGROW|wxALL, 0);
1027 >    wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL);
1028 >    itemBoxSizer12->Add(itemBoxSizer13, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0);
1029 >    titleText = new wxTextCtrl( itemPanel10, Title_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
1030 >    titleText->SetName(_T("Title_Text"));
1031 >    titleText->SetBackgroundColour(wxColour(240, 240, 240));
1032 >    itemBoxSizer13->Add(titleText, 1, wxGROW|wxLEFT, 5);
1033 >
1034 >    wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxVERTICAL);
1035 >    itemBoxSizer12->Add(itemBoxSizer15, 1, wxGROW|wxALL, 0);
1036 >    creatorText = new wxTextCtrl( itemPanel10, Author_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_RIGHT );
1037 >    creatorText->SetName(_T("Author_Text"));
1038 >    creatorText->SetBackgroundColour(wxColour(240, 240, 240));
1039 >    itemBoxSizer15->Add(creatorText, 1, wxGROW|wxRIGHT, 5);
1040 >
1041 >    wxStaticLine* itemStaticLine17 = new wxStaticLine( itemPanel10, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
1042 >    itemStaticLine17->Show(false);
1043 >    itemBoxSizer11->Add(itemStaticLine17, 0, wxGROW|wxALL, 5);
1044 >
1045 >    descriptionText = new wxTextCtrl( itemPanel10, Description_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH|wxTE_RICH2 );
1046 >    descriptionText->SetName(_T("DescriptionName"));
1047 >    descriptionText->SetBackgroundColour(wxColour(240, 240, 240));
1048 >    itemBoxSizer11->Add(descriptionText, 1, wxGROW|wxLEFT|wxRIGHT, 5);
1049 >
1050 >    MainSplitter->SplitVertically(itemPanel4, itemPanel10, 200);
1051 >    itemBoxSizer2->Add(MainSplitter, 1, wxGROW|wxALL, 0);
1052 >
1053 >    StatusArea = new wxStatusBar( itemFrame1, ID_STATUSBAR, 0 );
1054 >    StatusArea->SetName(_T("StatusArea"));
1055 >    StatusArea->SetFieldsCount(1);
1056 >    StatusArea->SetStatusText(_("AE Installer v1.0"), 0);
1057 >    itemBoxSizer2->Add(StatusArea, 0, wxGROW|wxALL, 0);
1058 >
1059 >    wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL);
1060 >    itemBoxSizer2->Add(itemBoxSizer20, 0, wxGROW|wxALL, 0);
1061 >
1062 >    ProgressBar = new wxGauge( itemFrame1, ProgressBar_Gauge, 1000, wxDefaultPosition, wxDefaultSize, wxGA_SMOOTH );
1063 >    ProgressBar->SetValue(0);
1064 >    itemBoxSizer20->Add(ProgressBar, 1, wxGROW|wxALL, 0);
1065 >
1066 >    InstallButton = new wxButton( itemFrame1, Install_Button, _("Install!"), wxDefaultPosition, wxDefaultSize, 0 );
1067 >    itemBoxSizer20->Add(InstallButton, 0, wxGROW|wxALL, 0);
1068 >
1069 >    wxBoxSizer* itemBoxSizer23 = new wxBoxSizer(wxVERTICAL);
1070 >    itemBoxSizer2->Add(itemBoxSizer23, 0, wxGROW|wxALL, 0);
1071 >
1072 >    OptionsPanel = new wxPanel( itemFrame1, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1073 >    itemBoxSizer2->Add(OptionsPanel, 0, wxGROW, 0);
1074 >
1075 >    wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxHORIZONTAL);
1076 >    OptionsPanel->SetSizer(itemBoxSizer25);
1077 >
1078 >    wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxVERTICAL);
1079 >    itemBoxSizer25->Add(itemBoxSizer26, 0, wxGROW|wxALL, 5);
1080 >
1081 >    SepRadio = new wxRadioButton( OptionsPanel, Sep_RadioButton, _("Sep"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1082 >    SepRadio->SetValue(false);
1083 >    if (MainWindow::ShowToolTips())
1084 >        SepRadio->SetToolTip(_("For PC Demo and Mac"));
1085 >    itemBoxSizer26->Add(SepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1086 >
1087 >    NoSepRadio = new wxRadioButton( OptionsPanel, NoSep_RadioButton, _("NoSep"), wxDefaultPosition, wxDefaultSize, 0 );
1088 >    NoSepRadio->SetValue(false);
1089 >    if (MainWindow::ShowToolTips())
1090 >        NoSepRadio->SetToolTip(_("For PC Retail"));
1091 >    itemBoxSizer26->Add(NoSepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1092 >
1093 >    wxStaticLine* itemStaticLine29 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1094 >    itemBoxSizer25->Add(itemStaticLine29, 0, wxGROW|wxALL, 5);
1095 >
1096 >    wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxVERTICAL);
1097 >    itemBoxSizer25->Add(itemBoxSizer30, 0, wxGROW|wxALL, 5);
1098 >
1099 >    SeperatedRadio = new wxRadioButton( OptionsPanel, Seperated_RadioButton, _("Separated Level0"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1100 >    SeperatedRadio->SetValue(false);
1101 >    SeperatedRadio->SetName(_T("Seperated_RadioButton"));
1102 >    itemBoxSizer30->Add(SeperatedRadio, 0, wxALIGN_LEFT|wxALL, 5);
1103 >
1104 >    CompleteRadio = new wxRadioButton( OptionsPanel, Complete_RadioButton, _("Complete Level0"), wxDefaultPosition, wxDefaultSize, 0 );
1105 >    CompleteRadio->SetValue(false);
1106 >    CompleteRadio->SetName(_T("Complete_RadioButton"));
1107 >    itemBoxSizer30->Add(CompleteRadio, 0, wxALIGN_LEFT|wxALL, 5);
1108 >
1109 >    wxStaticLine* itemStaticLine33 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1110 >    itemBoxSizer25->Add(itemStaticLine33, 0, wxGROW|wxALL, 5);
1111 >
1112 >    wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxVERTICAL);
1113 >    itemBoxSizer25->Add(itemBoxSizer34, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1114 >
1115 >    ReglobalizeButton = new wxButton( OptionsPanel, ReGlobalize_Button, _("Reglobalize"), wxDefaultPosition, wxDefaultSize, 0 );
1116 >    ReglobalizeButton->SetName(_T("Reglobalize_Button"));
1117 >    itemBoxSizer34->Add(ReglobalizeButton, 0, wxGROW|wxALL, 5);
1118  
1119 <        // Connect events and objects
1120 <        Mods_CheckboxList->Connect(Mods_CheckboxList1, wxEVT_CREATE, wxWindowCreateEventHandler(MainWindow::ModList_OnCreate), NULL, this);
1119 >    // Connect events and objects
1120 >    Mods_CheckboxList->Connect(Mods_CheckboxList1, wxEVT_CREATE, wxWindowCreateEventHandler(MainWindow::ModList_OnCreate), NULL, this);
1121          ////@end MainWindow content construction
1122  
1123          if ( exists( "../../GameDataFolder/level0_Final.sep" ) ) {
1124 <                static_cast<string>("-import:sep");
1124 >                strImportOption = "-import:sep";
1125                  splitInstances = NOT_SPLIT;
1126          }
1127          else {
1128 <                static_cast<string>("-import:nosep");
1128 >                strImportOption = "-import:nosep";
1129                  splitInstances = SPLIT;
1130          }
1131 <
1131 >        
1132          globalPackages = getPackages();
1133          globalInstalledMods = getInstallString();
1134          for (int i = 0; i < globalPackages.size(); i++) {
# Line 1108 | Line 1140 | void MainWindow::CreateControls()
1140          TheInstallButton = InstallButton;
1141          TheProgressBar = ProgressBar;
1142          OptionsPanel->Hide();
1143 <        if(splitInstances == SPLIT) SeparatedRadio->SetValue(true);
1143 >        
1144 > //#ifndef WIN32
1145 > //      itemMenu37->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
1146 >        
1147 > //#endif
1148 >        
1149 >        if(splitInstances == SPLIT) SeperatedRadio->SetValue(true);
1150          else CompleteRadio->SetValue(true);
1113
1114
1115
1151          if(strImportOption == "-import:nosep") NoSepRadio->SetValue(true);
1152          else SepRadio->SetValue(true);
1153 <        
1154 <        
1153 >
1154 >
1155   #ifdef WIN32
1156          RedirectIOToConsole();
1157          HWND hWnd = GetConsoleWindow();
1158          ShowWindow( hWnd, SW_HIDE );
1159   #endif
1160 <        
1161 <                //MainWindow::SetSize(MainWindow::GetRect().GetWidth(), MainWindow::GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight() );
1160 >
1161 >        //MainWindow::SetSize(MainWindow::GetRect().GetWidth(), MainWindow::GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight() );
1162   }
1163  
1164  
# Line 1180 | Line 1215 | wxBitmap MainWindow::GetBitmapResource(
1215   {
1216          // Bitmap retrieval
1217          ////@begin MainWindow bitmap retrieval
1218 <        wxUnusedVar(name);
1219 <        if (name == _T("redo.xpm"))
1220 <        {
1221 <                wxBitmap bitmap(redo_xpm);
1222 <                return bitmap;
1223 <        }
1224 <        else if (name == _T("fileopen.xpm"))
1225 <        {
1226 <                wxBitmap bitmap( fileopen_xpm);
1227 <                return bitmap;
1228 <        }
1229 <        else if (name == _T("filesaveas.xpm"))
1230 <        {
1231 <                wxBitmap bitmap( filesaveas_xpm);
1232 <                return bitmap;
1233 <        }
1234 <        else if (name == _T("quit.xpm"))
1235 <        {
1236 <                wxBitmap bitmap( quit_xpm);
1237 <                return bitmap;
1238 <        }
1239 <        return wxNullBitmap;
1218 >    wxUnusedVar(name);
1219 >    if (name == _T("undo.xpm"))
1220 >    {
1221 >        wxBitmap bitmap( undo_xpm);
1222 >        return bitmap;
1223 >    }
1224 >    else if (name == _T("fileopen.xpm"))
1225 >    {
1226 >        wxBitmap bitmap( fileopen_xpm);
1227 >        return bitmap;
1228 >    }
1229 >    else if (name == _T("filesaveas.xpm"))
1230 >    {
1231 >        wxBitmap bitmap( filesaveas_xpm);
1232 >        return bitmap;
1233 >    }
1234 >    else if (name == _T("quit.xpm"))
1235 >    {
1236 >        wxBitmap bitmap( quit_xpm);
1237 >        return bitmap;
1238 >    }
1239 >    return wxNullBitmap;
1240          ////@end MainWindow bitmap retrieval
1241   }
1242  
# Line 1214 | Line 1249 | wxIcon MainWindow::GetIconResource( cons
1249  
1250          // Icon retrieval
1251          ////@begin MainWindow icon retrieval
1252 <        wxUnusedVar(name);
1253 <        if (name == _T("oni_special.ico"))
1254 <        {
1255 <        //      wxIcon icon(_T("oni_special.ico"), wxBITMAP_TYPE_ICO);
1256 <        //      return icon;
1257 <        }
1258 <        return wxNullIcon;
1252 >    wxUnusedVar(name);
1253 >    if (name == _T("aelogosmall.png"))
1254 >    {
1255 >        wxIcon icon(aelogosmall_xpm);
1256 >        return icon;
1257 >    }
1258 >    return wxNullIcon;
1259          ////@end MainWindow icon retrieval
1260   }
1261  
# Line 1268 | Line 1303 | void MainWindow::OnModsCheckboxList1Togg
1303  
1304   void MainWindow::OnOptionsClick( wxCommandEvent& event )
1305   {
1271
1272
1273        
1274
1306          if (!event.GetInt() ) {
1307                  OptionsPanel->Hide();
1308 <                MainWindow::SetSize(MainWindow::GetRect().GetWidth(), MainWindow::GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight());}
1308 >                
1309 >                this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight());}
1310          else {
1311 <                //Uncomment this when we release, it gets annoying if you are testing globalization a lot ;)
1312 <                //wxMessageDialog* YesNoDialog = new wxMessageDialog(this,                      "WARNING: These options are for advanced users only, use with caution.", "AE Installer Alert",  wxOK | wxICON_EXCLAMATION       , wxDefaultPosition);
1313 <                //YesNoDialog->ShowModal();
1311 > //              Uncomment this when we release, it gets annoying if you are testing globalization a lot ;)
1312 >                wxMessageDialog* YesNoDialog = new wxMessageDialog(this,                        "WARNING: These options are for advanced users only, use with caution.",
1313 >                                                                                                                   "AE Installer Alert",  wxOK | wxICON_EXCLAMATION     , wxDefaultPosition);
1314 >                YesNoDialog->ShowModal();
1315                  OptionsPanel->Show();
1316 <                MainWindow::SetSize(MainWindow::GetRect().GetWidth(), MainWindow::GetRect().GetHeight()+OptionsPanel->GetRect().GetHeight());
1316 >                this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()+OptionsPanel->GetRect().GetHeight()+1);
1317 >                this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()-1);
1318          }
1319   }
1320  
# Line 1320 | Line 1354 | void MainWindow::OnInstallButtonClick( w
1354          localPackages.push_back("Globalize");
1355          for(int i = 0; i < globalPackages.size(); i++) if(Mods_CheckboxList->IsChecked(i)) localPackages.push_back( globalPackages[i].modStringName );
1356          if ( !localPackages.empty() )   {
1357 <
1357 >        
1358                  //MainWindow::MainWindow().Hide();      
1359                  //      boost::thread thrd2(recompileAll(localPackages) );
1360                  //MainWindow::MainWindow().Show();
1361 +                this->InstallButton->Disable();
1362 +                this->ReglobalizeButton->Disable();
1363   #ifdef WIN32
1364                  recompile packages(localPackages);
1365                  boost::thread thrd(packages);
1366   #else
1331                this->Disable();
1367                  recompileAll(localPackages);
1333                this->Enable();
1368   #endif
1369  
1370 +                this->InstallButton->Enable();
1371 +                this->ReglobalizeButton->Enable();
1372          }
1373  
1374  
# Line 1365 | Line 1401 | void setProgressBar( int i ) {
1401   void MainWindow::OnStatusbarUpdate( wxUpdateUIEvent& event )
1402   {
1403          ////@begin wxEVT_UPDATE_UI event handler for ID_STATUSBAR in MainWindow.
1404 <        // Before editing this code, remove the block markers.
1405 <        event.Skip();
1404 >    // Before editing this code, remove the block markers.
1405 >    event.Skip();
1406          ////@end wxEVT_UPDATE_UI event handler for ID_STATUSBAR in MainWindow.
1407   }
1408  
# Line 1378 | Line 1414 | void MainWindow::OnStatusbarUpdate( wxUp
1414   void MainWindow::OnAboutClick( wxCommandEvent& event )
1415   {
1416          ////@begin wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow.
1417 <        // Before editing this code, remove the block markers.
1418 <        About* window = new About(this);
1419 <        int returnValue = window->ShowModal();
1420 <        window->Destroy();
1417 >    // Before editing this code, remove the block markers.
1418 >    About* window = new About(this);
1419 >    int returnValue = window->ShowModal();
1420 >    window->Destroy();
1421          ////@end wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow.
1422   }
1423  
# Line 1410 | Line 1446 | void MainWindow::OnSepRadioButtonSelecte
1446   * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton
1447   */
1448  
1413 void MainWindow::OnSeparatedRadioButtonSelected( wxCommandEvent& event )
1414 {
1415        splitInstances = SPLIT;
1416
1417 }
1418
1419
1449   /*
1450   * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Complete_RadioButton
1451   */
# Line 1459 | Line 1488 | void MainWindow::refreshMods (vector<str
1488  
1489   void MainWindow::OnLoadClick( wxCommandEvent& event )
1490   {
1491 +        if (busy == 1) return;
1492          static const wxChar *FILETYPES = _T(
1493                  "Mod Loadouts (*.cfg)|*.cfg|"
1494                  "All files (*.*)|*.*"
# Line 1483 | Line 1513 | void MainWindow::OnLoadClick( wxCommandE
1513  
1514   void MainWindow::OnSaveClick( wxCommandEvent& event )
1515   {
1516 +        if (busy == 1) return;
1517          static const wxChar *FILETYPES = _T(
1518                  "Mod Loadouts (*.cfg)|*.cfg|"
1519                  "All files (*.*)|*.*"
# Line 1538 | Line 1569 | void MainWindow::OnSaveClick( wxCommandE
1569  
1570   void MainWindow::OnReGlobalizeButtonClick( wxCommandEvent& event )
1571   {
1572 <        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);
1572 >        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);
1573  
1574          if (YesNoDialog->ShowModal() == wxID_NO) { //if the user said no...
1575 <                
1575 >
1576          }
1577          else {
1547                
1578          
1579 +                this->InstallButton->Disable();
1580 +                this->ReglobalizeButton->Disable();
1581  
1582   #ifdef WIN32
1583  
1584 <        boost::thread thrd2(globalizeData);
1585 <        //globalizeData();
1586 <        //boost::thread::create_thread(&globalizeData);
1587 <        //       boost::thread_group Tg;
1588 <        // Tg.create_thread( &globalizeData(), this );
1584 >                boost::thread thrd2(globalizeData);
1585 >                //globalizeData();
1586 >                //boost::thread::create_thread(&globalizeData);
1587 >                //       boost::thread_group Tg;
1588 >                // Tg.create_thread( &globalizeData(), this );
1589   #else
1590 <        globalizeData();
1559 <        setProgressBar(1000);
1560 <        setStatusArea("Done!");
1590 >                globalizeData();
1591   #endif
1592 < }
1592 >                
1593 >                this->InstallButton->Enable();
1594 >                this->ReglobalizeButton->Enable();
1595 >        }
1596  
1597   }
1598   /*
# Line 1574 | Line 1607 | event.Skip();
1607   ////@end wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton in MainWindow.
1608   }*/
1609  
1610 +
1611 + /*
1612 + * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Seperated_RadioButton
1613 + */
1614 +
1615 + void MainWindow::OnSeperatedRadioButtonSelected( wxCommandEvent& event )
1616 + {
1617 + splitInstances = SPLIT;
1618 + }
1619 +

Diff Legend

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