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 392 by gumby, Mon Jul 6 14:44:10 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 58 | Line 58 | using namespace std;
58   #include "boost/date_time/date_parsing.hpp"
59   #include "boost/date_time/posix_time/posix_time.hpp"
60  
61 + string escapePath(string input) {
62 +        
63 +        string output;
64 +        string escape_me = "& ;()|<>\"'\\#*?$";
65 +        for(int i = 0; i < input.size(); i++)  {
66 +                for(int j = 0; j < escape_me.size(); j++) if (input[i] == escape_me[j]) output += '//';
67 +                output += input[i];
68 +        }
69 +        return output;
70 + }
71 +
72   int globalizeData(void)
73   {
74 <            using boost::lexical_cast;
75 <    using boost::bad_lexical_cast;
76 < // using namespace boost::posix_time;
74 >        busy = 1;
75 >        using boost::lexical_cast;
76 >        using boost::bad_lexical_cast;
77 >        // using namespace boost::posix_time;
78          using namespace boost::gregorian;
79          using namespace boost::posix_time;
80          ptime start_time(second_clock::local_time());
# Line 76 | Line 88 | int globalizeData(void)
88          ofstream logfile("Globalize.log");
89          logfile << "Globalization started " << to_simple_string(start_time) << endl;
90          try {
91 <                
91 >
92                  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.
93                  //const vector<double> ck(cv, &cv[CvSize]);
94                  vector<string> levels;
# Line 95 | Line 107 | int globalizeData(void)
107                  path Animations = "../GameDataFolder/level0_Animations";
108                  path TRAC = Animations / "level0_TRAC";
109                  path TRAM = Animations / "level0_TRAM";
110 <                
110 >
111                  vector<path> GDFPaths;
112                  GDFPaths.push_back(Characters);
113                  GDFPaths.push_back(Particles);
# Line 103 | Line 115 | int globalizeData(void)
115                  GDFPaths.push_back(Sounds);
116                  GDFPaths.push_back(TRAC);
117                  GDFPaths.push_back(TRAM);
118 <                
119 <                        
118 >
119 >
120                  path VanillaCharacters = "packages/VanillaDats/level0_Final/level0_Characters/level0_Characters.oni";
121                  path VanillaParticles = "packages/VanillaDats/level0_Final/level0_Particles/level0_Particles.oni";
122                  path VanillaTextures  = "packages/VanillaDats/level0_Final/level0_Textures/level0_Textures.oni";
# Line 114 | Line 126 | int globalizeData(void)
126                  path VanillaTRAM = "packages/VanillaDats/level0_Final/level0_Animations/level0_TRAM.oni";
127  
128                  vector<path> VanillaPaths;
129 <                
129 >
130                  VanillaPaths.push_back(VanillaCharacters);
131                  VanillaPaths.push_back(VanillaParticles);
132                  VanillaPaths.push_back(VanillaTextures);
133                  VanillaPaths.push_back(VanillaSounds);
134                  VanillaPaths.push_back(VanillaTRAC);
135                  VanillaPaths.push_back(VanillaTRAM);
136 <                
136 >
137                  /*
138                  if (exists("../GameDataFolder/"))
139                  {
# Line 142 | Line 154 | int globalizeData(void)
154                  setStatusArea("Creating needed directories...");
155                  logfile <<  "Creating needed directories...\n";
156                  create_directory( "../GameDataFolder/" );
157 <                
157 >
158                  create_directory( "packages" );
159 <                
159 >
160                  if (exists("packages/VanillaDats")) remove_all("packages/VanillaDats");
161                  create_directory( "packages/VanillaDats" );
150                
162                  create_directory( "packages/VanillaDats/level0_Final/" );
163                  //blah blah finish this.
164                  //logfile <<  "packages/VanillaDats/level0_Final/ created";
# Line 162 | Line 173 | int globalizeData(void)
173                  int num_levels = 0;
174                  for(int i = 1; i < 15; i++)
175                  {
176 <                                if (exists("../../GameDataFolder/level" + levels[i] + "_Final.dat")) {
176 >                        if (exists("../../GameDataFolder/level" + levels[i] + "_Final.dat")) {
177                                  num_levels++;
178  
179                          }
# Line 171 | Line 182 | int globalizeData(void)
182                  int total_steps =  8 + 2 * num_levels;
183                  for(int i = 0; i < 15; i++)
184                  {
185 <                        
185 >
186                          //printf(levels[i],"%d",levels[i]); // int to char array
187 <                        
187 >
188                          if (exists("../../GameDataFolder/level" + levels[i] + "_Final.dat")) {
189                                  logfile << "level" << levels[i] << "_Final\n";
190                                  logfile << "\tExporting level" << levels[i] << "_Final.dat\n";
191                                  //printf(Step_x_x,"Step %d/%d: exporting level%d_final.dat", parts_done + 1,, levels[i]); setStatusArea((string)Step_x_x);
192                                  setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + " exporting level" + levels[i]+"_Final.dat");
193                                  create_directory( "../GameDataFolder/level" + levels[i] + "_Final" );
194 < //                              setStatusArea(strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat");
194 >                                //                              setStatusArea(strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat");
195                                  system((strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat").c_str());
196                                  create_directory( "packages/VanillaDats/level" + levels[i] + "_Final" );
197                                  create_directory( "packages/VanillaDats/level" + levels[i] + "_Final/level" + levels[i] + "_Final" );
# Line 256 | Line 267 | int globalizeData(void)
267                                                  else if (dir_itr->path().filename().substr(0,4) == "AGDB"
268                                                          || dir_itr->path().filename().substr(0,4) == "TRCM") {
269                                                                  cout <<dir_itr->path().filename() << "\n";
270 <                                        
270 >
271                                                                  if(!exists( Archive / dir_itr->filename())) rename(dir_itr->path(), Archive / dir_itr->filename());
272                                                                  else remove(dir_itr->path());
273                                                  }
274 +                                                else if (dir_itr->path().filename().substr(0,4) == "ONWC") { //fix for buggy ONWC overriding
275 +                                                                cout <<dir_itr->path().filename() << "\n";
276 +
277 +                                                                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());
278 +                                                                else remove(dir_itr->path());
279 +                                                }
280                                                  if (exists(dir_itr->path())) {
281  
282                                                  }
283                                                  else {
284 <                                                        logfile << "\tMoved file: " << dir_itr->path().filename() << "\n";
284 >                                                        //logfile << "\tMoved file: " << dir_itr->path().filename() << "\n";
285                                                  }
286                                          }
287  
288  
289 <                                                
289 >
290                                  }
291                                  logfile << "\tCleaning up TXMPs...\n";
292                                  system( (strOniSplit + " -move:delete " + Textures.string() + " ../GameDataFolder/level" + levels[i] + "_Final/TXMP*.oni").c_str());
293                                  parts_done++;
294  
295                                  setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) ));
296 <                                
296 >
297                          }
298                  }
299                  logfile << "Reimporting levels\n";
# Line 286 | Line 303 | int globalizeData(void)
303                          //printf(levels[i],"%d",levels[i]);
304                          //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");
305                          setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + " reimporting level" + levels[i]+"_Final.oni");
306 <                        system( (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level"
307 <                                + levels[i] + "_Final/level" + levels[i] + "_Final.oni > Globalize.oni").c_str());
306 >                        logfile << (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level"
307 >                                + levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize.log").c_str() << '\n';
308 >                        string sys_str = (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level"
309 >                                + levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize2.log");
310 >                                system(sys_str.c_str() );
311                          setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) ));
312 <                                parts_done++;
312 >                        parts_done++;
313                  }
314                  create_directory( VanillaCharacters.parent_path() );
315                  create_directory( VanillaParticles.parent_path() );
316                  create_directory( VanillaTextures.parent_path() );
317                  create_directory( VanillaSounds.parent_path() );
318                  create_directory( VanillaAnimations.remove_filename() );
319 <                
319 >
320                  for(int j = 0; j < GDFPaths.size(); j++) {
321                          logfile << "\tReimporting " << GDFPaths[j].filename() << ".oni\n";
322 <                        setStatusArea("Step" + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + ": reimporting " + GDFPaths[j].filename() );
322 >                        setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + ": reimporting " + GDFPaths[j].filename() );
323                          system((strOniSplit + " " + strImportOption + " " + GDFPaths[j].string() + " " + VanillaPaths[j].string()).c_str());
324                          parts_done++;
325                          setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) ));
326                  }
327 < /*
327 >                /*
328                  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) ));
329                  system((strOniSplit + " " + strImportOption + " " + Characters.string() + " " + VanillaCharacters.string()).c_str());
330                  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 340 | int globalizeData(void)
340                  system((strOniSplit + " " + strImportOption + " " + TRAM.string() + " " + VanillaTRAM.string()).c_str());
341                  //parts_done++; setStatusArea((string)"Copying level scripts...");setProgressBar( (int)(1000 * (float)(parts_done) / (float)(7 + 2 * num_levels) ));
342                  if (exists("../GameDataFolder/IGMD")) remove_all("../GameDataFolder/IGMD");
343 < */
343 >                */
344                  create_directory((path)"../GameDataFolder/IGMD");
345 <                copy((path)"packages/VanillaBSL/", (path)"../GameDataFolder");
346 <                setProgressBar( 1000 );
347 <                setStatusArea((string)"Done! Now select your mod packages and click install.");
348 <        //      while(1) Sleep(-1);
345 >                copy((path)"packages/VanillaBSL/IGMD", (path)"../GameDataFolder");
346 >                setProgressBar( 1000 );
347 >                
348 >                // 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/
349 >                // or we could just include it in the zip in the proper place already.
350 >
351 >                copy("../../persist.dat","../persist.dat");
352 >                copy("../../keyconfig.txt","../keyconfig.txt");
353 > #ifndef WIN32
354 >                /* 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).
355 >                   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,
356 >                   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 */
357 >                path fullAEpath = system_complete("."); // get full path for Installer
358 >                char prefsCommand[300] = "defaults write com.godgames.oni RetailInstallationPath -string '";
359 >                strcat(prefsCommand, fullAEpath.parent_path().parent_path().string().c_str()); // get path of edition/ folder (Oni wants the folder that *contains* the GDF)
360 >                strcat(prefsCommand, "'"); // path string is enclosed in single quotes to avoid the need to escape UNIX-unfriendly characters
361 >                system(prefsCommand);
362                  
363 + #endif
364 +                
365 +                
366 +                setStatusArea((string)"Done! Now select your mod packages and click install.");
367 +                //      while(1) Sleep(-1);
368 +
369          }
370          catch (exception ex) {
371                  setStatusArea("Warning, handled exception: " + (string)ex.what());
372          }
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();
373  
374 +        ptime end_time(second_clock::local_time());
375 +        time_period total_time (start_time, end_time);
376 +        logfile << "\n\nGlobalization ended " << to_simple_string(end_time) << "\nThe process took " << total_time.length();
377 +        //total_time.length().hours();
378 +        logfile.close();
379 +        busy = 0;
380          return err;
381   }
382  
# Line 490 | Line 529 | ModPackage fileToModPackage(fstream &fil
529  
530   void recompileAll(vector<string> installedMods)
531   {
532 +        busy = 1;
533          using namespace boost::gregorian;
534          using namespace boost::posix_time;
535 +        using boost::lexical_cast;
536 +        using boost::bad_lexical_cast;
537          
538          setStatusArea("Importing levels...");
539          //setStatusArea("Recompiling Data...");
# Line 550 | Line 592 | void recompileAll(vector<string> install
592                                                  }
593                                                  importCommand += " ../GameDataFolder/" + dir_itr->path().filename() + ".dat >> Install.log";
594  
595 <                                                printf(statusString,"%d/%i\0",j,numberOfDats);  
595 >                                                
596                                                  setProgressBar( (int)(1000 * (float)(j-1) / (float)numberOfDats) ); //100% * dat we're on / total dats
597 <                                                setStatusArea("Importing " +  dir_itr->path().filename() + " " + statusString);
597 >                                                setStatusArea("Step " + lexical_cast<std::string>(j) + '/' + lexical_cast<std::string>(numberOfDats)+ ": Importing " +  dir_itr->path().filename() + " ");
598  
599                                                  system(importCommand.c_str());
600                                                  //Sleep(1000);
# Line 563 | Line 605 | void recompileAll(vector<string> install
605                                  }
606                                  catch ( const std::exception & ex )
607                                  {
608 <                                        
609 <        remove("Install.log");
610 <        ofstream logfile("Install.log");
611 <        
612 <        
608 >
609 >                                        remove("Install.log");
610 >                                        ofstream logfile("Install.log");
611 >
612 >
613                                          logfile << "Warning, exception " << ex.what() << "!";
614                                          setStatusArea("Warning, exception " + (string)ex.what() + "!");
615 < logfile.close();        
615 >                                        logfile.close();        
616                                  }
617                          }
618  
619                  }
620                  catch( const std::exception & ex ) {
621 <        
622 <        remove("Install.log");
623 <        ofstream logfile("Install.log");
624 <        
625 <        
626 <                                        logfile << "Warning, exception " << ex.what() << "!";
627 <                                        setStatusArea("Warning, exception " + (string)ex.what() + "!");
628 < logfile.close();
621 >
622 >                        remove("Install.log");
623 >                        ofstream logfile("Install.log");
624 >
625 >
626 >                        logfile << "Warning, exception " << ex.what() << "!";
627 >                        setStatusArea("Warning, exception " + (string)ex.what() + "!");
628 >                        logfile.close();
629                  }
630  
631          }
# Line 614 | Line 656 | logfile.close();
656                          {
657                                  if ( is_directory( dir_itr->status() ) )
658                                  {
659 <                                        importCommand = strOniSplit + " " + strImportOption + " " + vanilla_dir.string() + dir_itr->path().filename() + " " + "../GameDataFolder/" + dir_itr->path().filename()
618 <                                                + ".dat";
659 >                                        importCommand = strOniSplit + " " + strImportOption + " " + vanilla_dir.string() + dir_itr->path().filename() + " ";
660                                          for (int i = 0; i < installedMods.size(); ++i) {
661                                                  if (exists("packages/" + installedMods[i] + "/oni/" + dir_itr->path().filename()  ))
662                                                          importCommand += " packages/" + installedMods[i] + "/oni/" + dir_itr->path().filename();
663                                          }
664                                          importCommand += " ../GameDataFolder/" + dir_itr->path().filename() + ".dat >> Install.log";
665  
666 <                                        printf(statusString,"%d/%i\0",j,numberOfDats);  
666 >
667                                          setProgressBar( (int)(1000 * (float)(j-1) / (float)numberOfDats) ); //100% * dat we're on / total dats
668 <                                        setStatusArea("Importing " +  dir_itr->path().filename() + " " + statusString);
668 >                                        setStatusArea("Step " + lexical_cast<std::string>(j) + '/' + lexical_cast<std::string>(numberOfDats)+ ": Importing " +  dir_itr->path().filename() + " ");
669  
670                                          system(importCommand.c_str());
671  
# Line 633 | Line 674 | logfile.close();
674                          }
675                          catch ( const std::exception & ex )
676                          {
677 <        
678 <        remove("Install.log");
679 <        ofstream logfile("Install.log");
680 <        
681 <        
682 <                                        logfile << "Warning, exception " << ex.what() << "!";
683 <                                        setStatusArea("Warning, exception " + (string)ex.what() + "!");
684 < logfile.close();
677 >
678 >                                remove("Install.log");
679 >                                ofstream logfile("Install.log");
680 >
681 >
682 >                                logfile << "Warning, exception " << ex.what() << "!";
683 >                                setStatusArea("Warning, exception " + (string)ex.what() + "!");
684 >                                logfile.close();
685                          }}
686          }
687          logfile << "Writing config file";
688          writeInstalledMods(installedMods);
689          setProgressBar(1000);
690          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();
691  
692 <                //total_time.length().hours();
693 <        
692 >        ptime end_time(second_clock::local_time());
693 >        time_period total_time (start_time, end_time);
694 >
695 >
696 >        ofstream logfile2("Install.log", ios::app | ios::ate);
697 >        string outstring = (string)"\n\nGlobalization ended " + to_simple_string(end_time) + "\nThe process took ";// + (string)total_time.length();
698 >
699 >        logfile2 << "\nGlobalization ended " << to_simple_string(end_time) << "\nThe process took " << total_time.length();
700 >
701 >        //logfile2.write(outstring.c_str(), outstring.length());
702 >        logfile2.close();
703 >
704 >        //total_time.length().hours();
705 >
706          Sleep(1000);
707          setProgressBar(0);
708 +        busy = 0;
709   }
710  
711   void writeInstalledMods(vector<string> installedMods)
# Line 775 | Line 817 | vector<ModPackage> globalPackages;
817   #endif
818  
819   ////@begin includes
820 < #include "about_window.h"
820 > #include "about.h"
821   ////@end includes
822  
823   #include "main_window.h"
824  
825   ////@begin XPM images
826 < #include "redo.xpm"
826 > #include "aelogosmall.xpm"
827 > #include "undo.xpm"
828   #include "fileopen.xpm"
829   #include "filesaveas.xpm"
830   #include "quit.xpm"
# Line 804 | Line 847 | IMPLEMENT_CLASS( MainWindow, wxFrame )
847   BEGIN_EVENT_TABLE( MainWindow, wxFrame )
848  
849   ////@begin MainWindow event table entries
850 < EVT_CHECKBOX( SelectAll_Checkbox, MainWindow::OnSelectAllCheckboxClick )
850 >    EVT_CHECKBOX( SelectAll_Checkbox, MainWindow::OnSelectAllCheckboxClick )
851  
852 < EVT_BUTTON( Refresh_Button, MainWindow::OnRefreshButtonClick )
852 >    EVT_BUTTON( Refresh_Button, MainWindow::OnRefreshButtonClick )
853  
854 < EVT_LISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Selected )
855 < EVT_CHECKLISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Toggled )
854 >    EVT_LISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Selected )
855 >    EVT_CHECKLISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Toggled )
856  
857 < EVT_UPDATE_UI( ID_STATUSBAR, MainWindow::OnStatusbarUpdate )
857 >    EVT_UPDATE_UI( ID_STATUSBAR, MainWindow::OnStatusbarUpdate )
858  
859 < EVT_BUTTON( Install_Button, MainWindow::OnInstallButtonClick )
859 >    EVT_BUTTON( Install_Button, MainWindow::OnInstallButtonClick )
860  
861 < EVT_RADIOBUTTON( Sep_RadioButton, MainWindow::OnSepRadioButtonSelected )
861 >    EVT_RADIOBUTTON( Sep_RadioButton, MainWindow::OnSepRadioButtonSelected )
862  
863 < EVT_RADIOBUTTON( NoSep_RadioButton, MainWindow::OnNoSepRadioButtonSelected )
863 >    EVT_RADIOBUTTON( NoSep_RadioButton, MainWindow::OnNoSepRadioButtonSelected )
864  
865 < EVT_RADIOBUTTON( Separated_RadioButton, MainWindow::OnSeparatedRadioButtonSelected )
865 >    EVT_RADIOBUTTON( Seperated_RadioButton, MainWindow::OnSeperatedRadioButtonSelected )
866  
867 < EVT_RADIOBUTTON( Complete_RadioButton, MainWindow::OnCompleteRadioButtonSelected )
867 >    EVT_RADIOBUTTON( Complete_RadioButton, MainWindow::OnCompleteRadioButtonSelected )
868  
869 < EVT_BUTTON( ReGlobalize_Button, MainWindow::OnReGlobalizeButtonClick )
869 >    EVT_BUTTON( ReGlobalize_Button, MainWindow::OnReGlobalizeButtonClick )
870  
871 < EVT_MENU( wxID_LOAD, MainWindow::OnLoadClick )
871 >    EVT_MENU( wxID_LOAD, MainWindow::OnLoadClick )
872  
873 < EVT_MENU( wxID_SAVE, MainWindow::OnSaveClick )
873 >    EVT_MENU( wxID_SAVE, MainWindow::OnSaveClick )
874  
875 < EVT_MENU( wxID_EXIT, MainWindow::OnExitClick )
875 >    EVT_MENU( wxID_EXIT, MainWindow::OnExitClick )
876  
877 < EVT_MENU( wxID_OPTIONS, MainWindow::OnOptionsClick )
877 >    EVT_MENU( wxID_OPTIONS, MainWindow::OnOptionsClick )
878  
879 < EVT_MENU( wxID_ABOUT, MainWindow::OnAboutClick )
879 >    EVT_MENU( wxID_ABOUT, MainWindow::OnAboutClick )
880  
881   ////@end MainWindow event table entries
882  
# Line 863 | Line 906 | MainWindow::MainWindow( wxWindow* parent
906   bool MainWindow::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
907   {
908          ////@begin MainWindow creation
909 <        wxFrame::Create( parent, id, caption, pos, size, style );
909 >    wxFrame::Create( parent, id, caption, pos, size, style );
910  
911 <        CreateControls();
912 <        SetIcon(GetIconResource(wxT("oni_special.ico")));
913 <        Centre();
871 <        
872 <        
911 >    CreateControls();
912 >    SetIcon(GetIconResource(wxT("aelogosmall.png")));
913 >    Centre();
914          ////@end MainWindow creation
915          return true;
916   }
# Line 893 | Line 934 | MainWindow::~MainWindow()
934   void MainWindow::Init()
935   {
936          ////@begin MainWindow member initialisation
937 <        MainSplitter = NULL;
938 <        SelectAll = NULL;
939 <        RefreshButton = NULL;
940 <        Mods_CheckboxList = NULL;
941 <        titleText = NULL;
942 <        creatorText = NULL;
943 <        descriptionText = NULL;
944 <        StatusArea = NULL;
945 <        ProgressBar = NULL;
946 <        InstallButton = NULL;
947 <        OptionsPanel = NULL;
948 <        SepRadio = NULL;
949 <        NoSepRadio = NULL;
950 <        SeparatedRadio = NULL;
951 <        CompleteRadio = NULL;
952 <        ReglobalizeButton = NULL;
937 >    MainSplitter = NULL;
938 >    SelectAll = NULL;
939 >    RefreshButton = NULL;
940 >    Mods_CheckboxList = NULL;
941 >    titleText = NULL;
942 >    creatorText = NULL;
943 >    descriptionText = NULL;
944 >    StatusArea = NULL;
945 >    ProgressBar = NULL;
946 >    InstallButton = NULL;
947 >    OptionsPanel = NULL;
948 >    SepRadio = NULL;
949 >    NoSepRadio = NULL;
950 >    SeperatedRadio = NULL;
951 >    CompleteRadio = NULL;
952 >    ReglobalizeButton = NULL;
953          ////@end MainWindow member initialisation
954  
955   }
# Line 923 | Line 964 | wxGauge* TheProgressBar;
964   void MainWindow::CreateControls()
965   {    
966          ////@begin MainWindow content construction
967 <        // Generated by DialogBlocks, 31/05/2009 19:03:55 (unregistered)
967 >    MainWindow* itemFrame1 = this;
968  
969 <        MainWindow* itemFrame1 = this;
970 <
971 <        wxMenuBar* menuBar = new wxMenuBar;
972 <        wxMenu* itemMenu37 = new wxMenu;
973 <        {
974 <                wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_LOAD, _("&Load Configuration..."), wxEmptyString, wxITEM_NORMAL);
975 <                wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("fileopen.xpm")));
976 <                menuItem->SetBitmap(bitmap);
977 <                itemMenu37->Append(menuItem);
978 <        }
979 <        {
980 <                wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_SAVE, _("&Save Configuration..."), wxEmptyString, wxITEM_NORMAL);
981 <                wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("filesaveas.xpm")));
982 <                menuItem->SetBitmap(bitmap);
983 <                itemMenu37->Append(menuItem);
984 <        }
985 <        itemMenu37->AppendSeparator();
986 <        {
987 <                wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_EXIT, _("Exit"), wxEmptyString, wxITEM_NORMAL);
988 <                wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("quit.xpm")));
989 <                menuItem->SetBitmap(bitmap);
990 <                itemMenu37->Append(menuItem);
991 <        }
992 <        menuBar->Append(itemMenu37, _("&File"));
993 <        wxMenu* itemMenu42 = new wxMenu;
994 <        itemMenu42->Append(wxID_OPTIONS, _("Show Advanced Options..."), wxEmptyString, wxITEM_CHECK);
995 <        menuBar->Append(itemMenu42, _("Options"));
955 <        wxMenu* itemMenu44 = new wxMenu;
956 <        itemMenu44->Append(wxID_HELP, _("Help"), wxEmptyString, wxITEM_NORMAL);
969 >    wxMenuBar* menuBar = new wxMenuBar;
970 >    wxMenu* itemMenu37 = new wxMenu;
971 >    {
972 >        wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_LOAD, _("&Load Configuration..."), wxEmptyString, wxITEM_NORMAL);
973 >        wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("fileopen.xpm")));
974 >        menuItem->SetBitmap(bitmap);
975 >        itemMenu37->Append(menuItem);
976 >    }
977 >    {
978 >        wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_SAVE, _("&Save Configuration..."), wxEmptyString, wxITEM_NORMAL);
979 >        wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("filesaveas.xpm")));
980 >        menuItem->SetBitmap(bitmap);
981 >        itemMenu37->Append(menuItem);
982 >    }
983 >    itemMenu37->AppendSeparator();
984 >    {
985 >        wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_EXIT, _("Exit"), wxEmptyString, wxITEM_NORMAL);
986 >        wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("quit.xpm")));
987 >        menuItem->SetBitmap(bitmap);
988 >        itemMenu37->Append(menuItem);
989 >    }
990 >    menuBar->Append(itemMenu37, _("&File"));
991 >    wxMenu* itemMenu42 = new wxMenu;
992 >    itemMenu42->Append(wxID_OPTIONS, _("Show Advanced Options..."), wxEmptyString, wxITEM_CHECK);
993 >    menuBar->Append(itemMenu42, _("Options"));
994 >    wxMenu* itemMenu44 = new wxMenu;
995 > #ifdef WIN32
996          itemMenu44->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
997          menuBar->Append(itemMenu44, _("Help"));
998 <        itemFrame1->SetMenuBar(menuBar);
998 > #else
999 >        itemMenu37->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
1000 > #endif  
1001 >
1002 >    itemFrame1->SetMenuBar(menuBar);
1003  
1004 <        wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
1005 <        itemFrame1->SetSizer(itemBoxSizer2);
1004 >    wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
1005 >    itemFrame1->SetSizer(itemBoxSizer2);
1006  
1007 <        MainSplitter = new wxSplitterWindow( itemFrame1, ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(100, 100), wxSP_LIVE_UPDATE|wxNO_BORDER );
1008 <        MainSplitter->SetMinimumPaneSize(150);
1009 <        MainSplitter->SetName(_T("MainSplitter"));
1010 <
1011 <        wxPanel* itemPanel4 = new wxPanel( MainSplitter, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1012 <        wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
1013 <        itemPanel4->SetSizer(itemBoxSizer5);
1014 <
1015 <        wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
1016 <        itemBoxSizer5->Add(itemBoxSizer6, 0, wxGROW|wxALL, 0);
1017 <        SelectAll = new wxCheckBox( itemPanel4, SelectAll_Checkbox, _("Select All/None"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE );
1018 <        SelectAll->SetValue(false);
1019 <        SelectAll->SetName(_T("SelectAll_Checkbox"));
1020 <        itemBoxSizer6->Add(SelectAll, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1021 <
1022 <        RefreshButton = new wxBitmapButton( itemPanel4, Refresh_Button, itemFrame1->GetBitmapResource(wxT("redo.xpm")), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
1023 <        RefreshButton->SetName(_T("RefreshButton"));
1024 <        itemBoxSizer6->Add(RefreshButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
1025 <
1026 <        wxArrayString Mods_CheckboxListStrings;
1027 <        Mods_CheckboxList = new wxCheckListBox( itemPanel4, Mods_CheckboxList1, wxDefaultPosition, wxDefaultSize, Mods_CheckboxListStrings, wxLB_HSCROLL );
1028 <        Mods_CheckboxList->SetName(_T("Mods_CheckboxList"));
1029 <        itemBoxSizer5->Add(Mods_CheckboxList, 1, wxGROW|wxALL, 0);
1030 <
1031 <        wxPanel* itemPanel10 = new wxPanel( MainSplitter, DescriptionHolder_Panel, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1032 <        itemPanel10->SetName(_T("DescriptionHolder_Panel"));
1033 <        wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL);
1034 <        itemPanel10->SetSizer(itemBoxSizer11);
1035 <
1036 <        wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
1037 <        itemBoxSizer11->Add(itemBoxSizer12, 0, wxGROW|wxALL, 0);
1038 <        wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL);
1039 <        itemBoxSizer12->Add(itemBoxSizer13, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0);
1040 <        titleText = new wxTextCtrl( itemPanel10, Title_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
1041 <        titleText->SetName(_T("Title_Text"));
1042 <        titleText->SetBackgroundColour(wxColour(240, 240, 240));
1043 <        itemBoxSizer13->Add(titleText, 1, wxGROW|wxLEFT, 5);
1044 <
1045 <        wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxVERTICAL);
1046 <        itemBoxSizer12->Add(itemBoxSizer15, 1, wxGROW|wxALL, 0);
1047 <        creatorText = new wxTextCtrl( itemPanel10, Author_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_RIGHT );
1048 <        creatorText->SetName(_T("Author_Text"));
1049 <        creatorText->SetBackgroundColour(wxColour(240, 240, 240));
1050 <        itemBoxSizer15->Add(creatorText, 1, wxGROW|wxRIGHT, 5);
1051 <
1052 <        wxStaticLine* itemStaticLine17 = new wxStaticLine( itemPanel10, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
1053 <        itemStaticLine17->Show(false);
1054 <        itemBoxSizer11->Add(itemStaticLine17, 0, wxGROW|wxALL, 5);
1055 <
1056 <        descriptionText = new wxTextCtrl( itemPanel10, Description_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH|wxTE_AUTO_URL );
1057 <        descriptionText->SetName(_T("DescriptionName"));
1058 <        descriptionText->SetBackgroundColour(wxColour(240, 240, 240));
1059 <        itemBoxSizer11->Add(descriptionText, 1, wxGROW|wxLEFT|wxRIGHT, 5);
1060 <
1061 <        MainSplitter->SplitVertically(itemPanel4, itemPanel10, 150);
1062 <        itemBoxSizer2->Add(MainSplitter, 1, wxGROW|wxALL, 0);
1063 <
1064 <        StatusArea = new wxStatusBar( itemFrame1, ID_STATUSBAR, 0 );
1065 <        StatusArea->SetName(_T("StatusArea"));
1066 <        StatusArea->SetFieldsCount(1);
1067 <        StatusArea->SetStatusText(_("Status Area"), 0);
1068 <        itemBoxSizer2->Add(StatusArea, 0, wxGROW|wxALL, 0);
1069 <
1070 <        wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL);
1071 <        itemBoxSizer2->Add(itemBoxSizer20, 0, wxGROW|wxALL, 0);
1072 <
1073 <        ProgressBar = new wxGauge( itemFrame1, ProgressBar_Gauge, 1000, wxDefaultPosition, wxSize(-1, 30), wxGA_SMOOTH );
1074 <        ProgressBar->SetValue(0);
1075 <        itemBoxSizer20->Add(ProgressBar, 1, wxGROW|wxALL, 0);
1076 <
1077 <        InstallButton = new wxButton( itemFrame1, Install_Button, _("Install!"), wxDefaultPosition, wxSize(-1, 30), 0 );
1078 <        itemBoxSizer20->Add(InstallButton, 0, wxGROW|wxALL, 0);
1079 <
1080 <        wxBoxSizer* itemBoxSizer23 = new wxBoxSizer(wxVERTICAL);
1081 <        itemBoxSizer2->Add(itemBoxSizer23, 0, wxGROW|wxALL, 0);
1082 <
1083 <        OptionsPanel = new wxPanel( itemFrame1, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1084 <        itemBoxSizer2->Add(OptionsPanel, 0, wxGROW, 0);
1085 <
1086 <        wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxHORIZONTAL);
1087 <        OptionsPanel->SetSizer(itemBoxSizer25);
1088 <
1089 <        wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxVERTICAL);
1090 <        itemBoxSizer25->Add(itemBoxSizer26, 0, wxGROW|wxALL, 5);
1091 <
1092 <        SepRadio = new wxRadioButton( OptionsPanel, Sep_RadioButton, _("Sep"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1093 <        SepRadio->SetValue(false);
1094 <        if (MainWindow::ShowToolTips())
1095 <                SepRadio->SetToolTip(_("For PC Demo and Mac"));
1096 <        itemBoxSizer26->Add(SepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1097 <
1098 <        NoSepRadio = new wxRadioButton( OptionsPanel, NoSep_RadioButton, _("NoSep"), wxDefaultPosition, wxDefaultSize, 0 );
1099 <        NoSepRadio->SetValue(false);
1100 <        if (MainWindow::ShowToolTips())
1101 <                NoSepRadio->SetToolTip(_("For PC Retail"));
1102 <        itemBoxSizer26->Add(NoSepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1103 <
1104 <        wxStaticLine* itemStaticLine29 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1105 <        itemBoxSizer25->Add(itemStaticLine29, 0, wxGROW|wxALL, 5);
1106 <
1107 <        wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxVERTICAL);
1108 <        itemBoxSizer25->Add(itemBoxSizer30, 0, wxGROW|wxALL, 5);
1109 <
1110 <        SeparatedRadio = new wxRadioButton( OptionsPanel, Separated_RadioButton, _("Separated Level0"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1111 <        SeparatedRadio->SetValue(false);
1112 <        SeparatedRadio->SetName(_T("Separated_RadioButton"));
1113 <        itemBoxSizer30->Add(SeparatedRadio, 0, wxALIGN_LEFT|wxALL, 5);
1114 <
1115 <        CompleteRadio = new wxRadioButton( OptionsPanel, Complete_RadioButton, _("Complete Level0"), wxDefaultPosition, wxDefaultSize, 0 );
1116 <        CompleteRadio->SetValue(false);
1117 <        CompleteRadio->SetName(_T("Complete_RadioButton"));
1118 <        itemBoxSizer30->Add(CompleteRadio, 0, wxALIGN_LEFT|wxALL, 5);
1119 <
1120 <        wxStaticLine* itemStaticLine33 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1121 <        itemBoxSizer25->Add(itemStaticLine33, 0, wxGROW|wxALL, 5);
1122 <
1123 <        wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxVERTICAL);
1124 <        itemBoxSizer25->Add(itemBoxSizer34, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1125 <
1126 <        ReglobalizeButton = new wxButton( OptionsPanel, ReGlobalize_Button, _("Reglobalize"), wxDefaultPosition, wxDefaultSize, 0 );
1127 <        ReglobalizeButton->SetName(_T("Reglobalize_Button"));
1128 <        itemBoxSizer34->Add(ReglobalizeButton, 0, wxGROW|wxALL, 5);
1007 >    MainSplitter = new wxSplitterWindow( itemFrame1, ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(100, 100), wxSP_LIVE_UPDATE|wxNO_BORDER );
1008 >    MainSplitter->SetMinimumPaneSize(1);
1009 >    MainSplitter->SetName(_T("MainSplitter"));
1010 >
1011 >    wxPanel* itemPanel4 = new wxPanel( MainSplitter, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1012 >    wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
1013 >    itemPanel4->SetSizer(itemBoxSizer5);
1014 >
1015 >    wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
1016 >    itemBoxSizer5->Add(itemBoxSizer6, 0, wxGROW|wxALL, 0);
1017 >    SelectAll = new wxCheckBox( itemPanel4, SelectAll_Checkbox, _("Select All/None"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE );
1018 >    SelectAll->SetValue(false);
1019 >    SelectAll->SetName(_T("SelectAll_Checkbox"));
1020 >    itemBoxSizer6->Add(SelectAll, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1021 >
1022 >    RefreshButton = new wxBitmapButton( itemPanel4, Refresh_Button, itemFrame1->GetBitmapResource(wxT("undo.xpm")), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
1023 >    RefreshButton->SetName(_T("RefreshButton"));
1024 >    itemBoxSizer6->Add(RefreshButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
1025 >
1026 >    wxArrayString Mods_CheckboxListStrings;
1027 >    Mods_CheckboxList = new wxCheckListBox( itemPanel4, Mods_CheckboxList1, wxDefaultPosition, wxDefaultSize, Mods_CheckboxListStrings, wxLB_HSCROLL );
1028 >    Mods_CheckboxList->SetName(_T("Mods_CheckboxList"));
1029 >    itemBoxSizer5->Add(Mods_CheckboxList, 1, wxGROW|wxALL, 0);
1030 >
1031 >    wxPanel* itemPanel10 = new wxPanel( MainSplitter, DescriptionHolder_Panel, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1032 >    itemPanel10->SetName(_T("DescriptionHolder_Panel"));
1033 >    wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL);
1034 >    itemPanel10->SetSizer(itemBoxSizer11);
1035 >
1036 >    wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
1037 >    itemBoxSizer11->Add(itemBoxSizer12, 0, wxGROW|wxALL, 0);
1038 >    wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL);
1039 >    itemBoxSizer12->Add(itemBoxSizer13, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0);
1040 >    titleText = new wxTextCtrl( itemPanel10, Title_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
1041 >    titleText->SetName(_T("Title_Text"));
1042 >    titleText->SetBackgroundColour(wxColour(240, 240, 240));
1043 >    itemBoxSizer13->Add(titleText, 1, wxGROW|wxLEFT, 5);
1044 >
1045 >    wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxVERTICAL);
1046 >    itemBoxSizer12->Add(itemBoxSizer15, 1, wxGROW|wxALL, 0);
1047 >    creatorText = new wxTextCtrl( itemPanel10, Author_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_RIGHT );
1048 >    creatorText->SetName(_T("Author_Text"));
1049 >    creatorText->SetBackgroundColour(wxColour(240, 240, 240));
1050 >    itemBoxSizer15->Add(creatorText, 1, wxGROW|wxRIGHT, 5);
1051 >
1052 >    wxStaticLine* itemStaticLine17 = new wxStaticLine( itemPanel10, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
1053 >    itemStaticLine17->Show(false);
1054 >    itemBoxSizer11->Add(itemStaticLine17, 0, wxGROW|wxALL, 5);
1055 >
1056 >    descriptionText = new wxTextCtrl( itemPanel10, Description_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH|wxTE_RICH2 );
1057 >    descriptionText->SetName(_T("DescriptionName"));
1058 >    descriptionText->SetBackgroundColour(wxColour(240, 240, 240));
1059 >    itemBoxSizer11->Add(descriptionText, 1, wxGROW|wxLEFT|wxRIGHT, 5);
1060 >
1061 >    MainSplitter->SplitVertically(itemPanel4, itemPanel10, 200);
1062 >    itemBoxSizer2->Add(MainSplitter, 1, wxGROW|wxALL, 0);
1063 >
1064 >    StatusArea = new wxStatusBar( itemFrame1, ID_STATUSBAR, 0 );
1065 >    StatusArea->SetName(_T("StatusArea"));
1066 >    StatusArea->SetFieldsCount(1);
1067 >    StatusArea->SetStatusText(_("AE Installer v1.0"), 0);
1068 >    itemBoxSizer2->Add(StatusArea, 0, wxGROW|wxALL, 0);
1069 >
1070 >    wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL);
1071 >    itemBoxSizer2->Add(itemBoxSizer20, 0, wxGROW|wxALL, 0);
1072 >
1073 >    ProgressBar = new wxGauge( itemFrame1, ProgressBar_Gauge, 1000, wxDefaultPosition, wxDefaultSize, wxGA_SMOOTH );
1074 >    ProgressBar->SetValue(0);
1075 >    itemBoxSizer20->Add(ProgressBar, 1, wxGROW|wxALL, 0);
1076 >
1077 >    InstallButton = new wxButton( itemFrame1, Install_Button, _("Install!"), wxDefaultPosition, wxDefaultSize, 0 );
1078 >    itemBoxSizer20->Add(InstallButton, 0, wxGROW|wxALL, 0);
1079 >
1080 >    wxBoxSizer* itemBoxSizer23 = new wxBoxSizer(wxVERTICAL);
1081 >    itemBoxSizer2->Add(itemBoxSizer23, 0, wxGROW|wxALL, 0);
1082 >
1083 >    OptionsPanel = new wxPanel( itemFrame1, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1084 >    itemBoxSizer2->Add(OptionsPanel, 0, wxGROW, 0);
1085 >
1086 >    wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxHORIZONTAL);
1087 >    OptionsPanel->SetSizer(itemBoxSizer25);
1088 >
1089 >    wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxVERTICAL);
1090 >    itemBoxSizer25->Add(itemBoxSizer26, 0, wxGROW|wxALL, 5);
1091 >
1092 >    SepRadio = new wxRadioButton( OptionsPanel, Sep_RadioButton, _("Sep"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1093 >    SepRadio->SetValue(false);
1094 >    if (MainWindow::ShowToolTips())
1095 >        SepRadio->SetToolTip(_("For PC Demo and Mac"));
1096 >    itemBoxSizer26->Add(SepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1097 >
1098 >    NoSepRadio = new wxRadioButton( OptionsPanel, NoSep_RadioButton, _("NoSep"), wxDefaultPosition, wxDefaultSize, 0 );
1099 >    NoSepRadio->SetValue(false);
1100 >    if (MainWindow::ShowToolTips())
1101 >        NoSepRadio->SetToolTip(_("For PC Retail"));
1102 >    itemBoxSizer26->Add(NoSepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1103 >
1104 >    wxStaticLine* itemStaticLine29 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1105 >    itemBoxSizer25->Add(itemStaticLine29, 0, wxGROW|wxALL, 5);
1106 >
1107 >    wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxVERTICAL);
1108 >    itemBoxSizer25->Add(itemBoxSizer30, 0, wxGROW|wxALL, 5);
1109 >
1110 >    SeperatedRadio = new wxRadioButton( OptionsPanel, Seperated_RadioButton, _("Separated Level0"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1111 >    SeperatedRadio->SetValue(false);
1112 >    SeperatedRadio->SetName(_T("Seperated_RadioButton"));
1113 >    itemBoxSizer30->Add(SeperatedRadio, 0, wxALIGN_LEFT|wxALL, 5);
1114 >
1115 >    CompleteRadio = new wxRadioButton( OptionsPanel, Complete_RadioButton, _("Complete Level0"), wxDefaultPosition, wxDefaultSize, 0 );
1116 >    CompleteRadio->SetValue(false);
1117 >    CompleteRadio->SetName(_T("Complete_RadioButton"));
1118 >    itemBoxSizer30->Add(CompleteRadio, 0, wxALIGN_LEFT|wxALL, 5);
1119 >
1120 >    wxStaticLine* itemStaticLine33 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1121 >    itemBoxSizer25->Add(itemStaticLine33, 0, wxGROW|wxALL, 5);
1122 >
1123 >    wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxVERTICAL);
1124 >    itemBoxSizer25->Add(itemBoxSizer34, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1125 >
1126 >    ReglobalizeButton = new wxButton( OptionsPanel, ReGlobalize_Button, _("Reglobalize"), wxDefaultPosition, wxDefaultSize, 0 );
1127 >    ReglobalizeButton->SetName(_T("Reglobalize_Button"));
1128 >    itemBoxSizer34->Add(ReglobalizeButton, 0, wxGROW|wxALL, 5);
1129  
1130 <        // Connect events and objects
1131 <        Mods_CheckboxList->Connect(Mods_CheckboxList1, wxEVT_CREATE, wxWindowCreateEventHandler(MainWindow::ModList_OnCreate), NULL, this);
1130 >    // Connect events and objects
1131 >    Mods_CheckboxList->Connect(Mods_CheckboxList1, wxEVT_CREATE, wxWindowCreateEventHandler(MainWindow::ModList_OnCreate), NULL, this);
1132          ////@end MainWindow content construction
1133  
1134          if ( exists( "../../GameDataFolder/level0_Final.sep" ) ) {
1135 <                static_cast<string>("-import:sep");
1135 >                strImportOption = "-import:sep";
1136                  splitInstances = NOT_SPLIT;
1137          }
1138          else {
1139 <                static_cast<string>("-import:nosep");
1139 >                strImportOption = "-import:nosep";
1140                  splitInstances = SPLIT;
1141          }
1142 <
1142 >        
1143          globalPackages = getPackages();
1144          globalInstalledMods = getInstallString();
1145          for (int i = 0; i < globalPackages.size(); i++) {
# Line 1108 | Line 1151 | void MainWindow::CreateControls()
1151          TheInstallButton = InstallButton;
1152          TheProgressBar = ProgressBar;
1153          OptionsPanel->Hide();
1154 <        if(splitInstances == SPLIT) SeparatedRadio->SetValue(true);
1154 >        
1155 > //#ifndef WIN32
1156 > //      itemMenu37->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
1157 >        
1158 > //#endif
1159 >        
1160 >        if(splitInstances == SPLIT) SeperatedRadio->SetValue(true);
1161          else CompleteRadio->SetValue(true);
1113
1114
1115
1162          if(strImportOption == "-import:nosep") NoSepRadio->SetValue(true);
1163          else SepRadio->SetValue(true);
1164 <        
1165 <        
1164 >
1165 >
1166   #ifdef WIN32
1167          RedirectIOToConsole();
1168          HWND hWnd = GetConsoleWindow();
1169          ShowWindow( hWnd, SW_HIDE );
1170   #endif
1171 <        
1172 <                //MainWindow::SetSize(MainWindow::GetRect().GetWidth(), MainWindow::GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight() );
1171 >
1172 >        //MainWindow::SetSize(MainWindow::GetRect().GetWidth(), MainWindow::GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight() );
1173   }
1174  
1175  
# Line 1180 | Line 1226 | wxBitmap MainWindow::GetBitmapResource(
1226   {
1227          // Bitmap retrieval
1228          ////@begin MainWindow bitmap retrieval
1229 <        wxUnusedVar(name);
1230 <        if (name == _T("redo.xpm"))
1231 <        {
1232 <                wxBitmap bitmap(redo_xpm);
1233 <                return bitmap;
1234 <        }
1235 <        else if (name == _T("fileopen.xpm"))
1236 <        {
1237 <                wxBitmap bitmap( fileopen_xpm);
1238 <                return bitmap;
1239 <        }
1240 <        else if (name == _T("filesaveas.xpm"))
1241 <        {
1242 <                wxBitmap bitmap( filesaveas_xpm);
1243 <                return bitmap;
1244 <        }
1245 <        else if (name == _T("quit.xpm"))
1246 <        {
1247 <                wxBitmap bitmap( quit_xpm);
1248 <                return bitmap;
1249 <        }
1250 <        return wxNullBitmap;
1229 >    wxUnusedVar(name);
1230 >    if (name == _T("undo.xpm"))
1231 >    {
1232 >        wxBitmap bitmap( undo_xpm);
1233 >        return bitmap;
1234 >    }
1235 >    else if (name == _T("fileopen.xpm"))
1236 >    {
1237 >        wxBitmap bitmap( fileopen_xpm);
1238 >        return bitmap;
1239 >    }
1240 >    else if (name == _T("filesaveas.xpm"))
1241 >    {
1242 >        wxBitmap bitmap( filesaveas_xpm);
1243 >        return bitmap;
1244 >    }
1245 >    else if (name == _T("quit.xpm"))
1246 >    {
1247 >        wxBitmap bitmap( quit_xpm);
1248 >        return bitmap;
1249 >    }
1250 >    return wxNullBitmap;
1251          ////@end MainWindow bitmap retrieval
1252   }
1253  
# Line 1214 | Line 1260 | wxIcon MainWindow::GetIconResource( cons
1260  
1261          // Icon retrieval
1262          ////@begin MainWindow icon retrieval
1263 <        wxUnusedVar(name);
1264 <        if (name == _T("oni_special.ico"))
1265 <        {
1266 <        //      wxIcon icon(_T("oni_special.ico"), wxBITMAP_TYPE_ICO);
1267 <        //      return icon;
1268 <        }
1269 <        return wxNullIcon;
1263 >    wxUnusedVar(name);
1264 >    if (name == _T("aelogosmall.png"))
1265 >    {
1266 >        wxIcon icon(aelogosmall_xpm);
1267 >        return icon;
1268 >    }
1269 >    return wxNullIcon;
1270          ////@end MainWindow icon retrieval
1271   }
1272  
# Line 1268 | Line 1314 | void MainWindow::OnModsCheckboxList1Togg
1314  
1315   void MainWindow::OnOptionsClick( wxCommandEvent& event )
1316   {
1271
1272
1273        
1274
1317          if (!event.GetInt() ) {
1318                  OptionsPanel->Hide();
1319 <                MainWindow::SetSize(MainWindow::GetRect().GetWidth(), MainWindow::GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight());}
1319 >                
1320 >                this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight());}
1321          else {
1322 <                //Uncomment this when we release, it gets annoying if you are testing globalization a lot ;)
1323 <                //wxMessageDialog* YesNoDialog = new wxMessageDialog(this,                      "WARNING: These options are for advanced users only, use with caution.", "AE Installer Alert",  wxOK | wxICON_EXCLAMATION       , wxDefaultPosition);
1324 <                //YesNoDialog->ShowModal();
1322 > //              Uncomment this when we release, it gets annoying if you are testing globalization a lot ;)
1323 >                wxMessageDialog* YesNoDialog = new wxMessageDialog(this,                        "WARNING: These options are for advanced users only, use with caution.",
1324 >                                                                                                                   "AE Installer Alert",  wxOK | wxICON_EXCLAMATION     , wxDefaultPosition);
1325 >                YesNoDialog->ShowModal();
1326                  OptionsPanel->Show();
1327 <                MainWindow::SetSize(MainWindow::GetRect().GetWidth(), MainWindow::GetRect().GetHeight()+OptionsPanel->GetRect().GetHeight());
1327 >                this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()+OptionsPanel->GetRect().GetHeight()+1);
1328 >                this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()-1);
1329          }
1330   }
1331  
# Line 1320 | Line 1365 | void MainWindow::OnInstallButtonClick( w
1365          localPackages.push_back("Globalize");
1366          for(int i = 0; i < globalPackages.size(); i++) if(Mods_CheckboxList->IsChecked(i)) localPackages.push_back( globalPackages[i].modStringName );
1367          if ( !localPackages.empty() )   {
1368 <
1368 >        
1369                  //MainWindow::MainWindow().Hide();      
1370                  //      boost::thread thrd2(recompileAll(localPackages) );
1371                  //MainWindow::MainWindow().Show();
1372 +                this->InstallButton->Disable();
1373 +                this->ReglobalizeButton->Disable();
1374   #ifdef WIN32
1375                  recompile packages(localPackages);
1376                  boost::thread thrd(packages);
1377   #else
1331                this->Disable();
1378                  recompileAll(localPackages);
1333                this->Enable();
1379   #endif
1380  
1381 +                this->InstallButton->Enable();
1382 +                this->ReglobalizeButton->Enable();
1383          }
1384  
1385  
# Line 1365 | Line 1412 | void setProgressBar( int i ) {
1412   void MainWindow::OnStatusbarUpdate( wxUpdateUIEvent& event )
1413   {
1414          ////@begin wxEVT_UPDATE_UI event handler for ID_STATUSBAR in MainWindow.
1415 <        // Before editing this code, remove the block markers.
1416 <        event.Skip();
1415 >    // Before editing this code, remove the block markers.
1416 >    event.Skip();
1417          ////@end wxEVT_UPDATE_UI event handler for ID_STATUSBAR in MainWindow.
1418   }
1419  
# Line 1378 | Line 1425 | void MainWindow::OnStatusbarUpdate( wxUp
1425   void MainWindow::OnAboutClick( wxCommandEvent& event )
1426   {
1427          ////@begin wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow.
1428 <        // Before editing this code, remove the block markers.
1429 <        About* window = new About(this);
1430 <        int returnValue = window->ShowModal();
1431 <        window->Destroy();
1428 >    // Before editing this code, remove the block markers.
1429 >    About* window = new About(this);
1430 >    int returnValue = window->ShowModal();
1431 >    window->Destroy();
1432          ////@end wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow.
1433   }
1434  
# Line 1410 | Line 1457 | void MainWindow::OnSepRadioButtonSelecte
1457   * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton
1458   */
1459  
1413 void MainWindow::OnSeparatedRadioButtonSelected( wxCommandEvent& event )
1414 {
1415        splitInstances = SPLIT;
1416
1417 }
1418
1419
1460   /*
1461   * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Complete_RadioButton
1462   */
# Line 1459 | Line 1499 | void MainWindow::refreshMods (vector<str
1499  
1500   void MainWindow::OnLoadClick( wxCommandEvent& event )
1501   {
1502 +        if (busy == 1) return;
1503          static const wxChar *FILETYPES = _T(
1504                  "Mod Loadouts (*.cfg)|*.cfg|"
1505                  "All files (*.*)|*.*"
# Line 1483 | Line 1524 | void MainWindow::OnLoadClick( wxCommandE
1524  
1525   void MainWindow::OnSaveClick( wxCommandEvent& event )
1526   {
1527 +        if (busy == 1) return;
1528          static const wxChar *FILETYPES = _T(
1529                  "Mod Loadouts (*.cfg)|*.cfg|"
1530                  "All files (*.*)|*.*"
# Line 1538 | Line 1580 | void MainWindow::OnSaveClick( wxCommandE
1580  
1581   void MainWindow::OnReGlobalizeButtonClick( wxCommandEvent& event )
1582   {
1583 <        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);
1583 >        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);
1584  
1585          if (YesNoDialog->ShowModal() == wxID_NO) { //if the user said no...
1586 <                
1586 >
1587          }
1588          else {
1547                
1589          
1590 +                this->InstallButton->Disable();
1591 +                this->ReglobalizeButton->Disable();
1592  
1593   #ifdef WIN32
1594  
1595 <        boost::thread thrd2(globalizeData);
1596 <        //globalizeData();
1597 <        //boost::thread::create_thread(&globalizeData);
1598 <        //       boost::thread_group Tg;
1599 <        // Tg.create_thread( &globalizeData(), this );
1595 >                boost::thread thrd2(globalizeData);
1596 >                //globalizeData();
1597 >                //boost::thread::create_thread(&globalizeData);
1598 >                //       boost::thread_group Tg;
1599 >                // Tg.create_thread( &globalizeData(), this );
1600   #else
1601 <        globalizeData();
1559 <        setProgressBar(1000);
1560 <        setStatusArea("Done!");
1601 >                globalizeData();
1602   #endif
1603 < }
1603 >                
1604 >                this->InstallButton->Enable();
1605 >                this->ReglobalizeButton->Enable();
1606 >        }
1607  
1608   }
1609   /*
# Line 1574 | Line 1618 | event.Skip();
1618   ////@end wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton in MainWindow.
1619   }*/
1620  
1621 +
1622 + /*
1623 + * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Seperated_RadioButton
1624 + */
1625 +
1626 + void MainWindow::OnSeperatedRadioButtonSelected( wxCommandEvent& event )
1627 + {
1628 + splitInstances = SPLIT;
1629 + }
1630 +

Diff Legend

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