source: AE/Installer/trunk/source/main_window.cpp @ 396

Last change on this file since 396 was 396, checked in by gumby, 14 years ago

Fixed split Globalization log

  • Property svn:executable set to *
File size: 56.4 KB
Line 
1#ifndef NTDDI_VERSION           
2#define NTDDI_VERSION NTDDI_WIN7
3#endif
4#ifdef WIN32
5 #include <windows.h>
6#include <shobjidl.h>
7HWND Handle;
8
9ITaskbarList *pTaskbarList;
10ITaskbarList3 *pTaskbarList3;
11#endif
12
13/*
14 AE/Mod Installer
15 by Gumby and Iritscen
16*/
17
18// To-do: - Load credits from text resource file
19//                - Institute lots of checks into file-handling
20//                - Clear mod info fields when mod is de-selected
21
22#define DEBUG
23#include <stdio.h>
24//#include <conio.h>
25//#include <process.h>
26#include <string>
27#include <iostream>
28#include <cctype>
29#include <vector>
30#include <fstream>
31#include <errno.h>
32#include <sstream>
33
34#include "boost/filesystem.hpp" // includes all needed Boost.Filesystem declarations
35#include "boost/lexical_cast.hpp" //int -> string
36#include "installer.h"
37
38#ifdef WIN32
39#include <windows.h>
40#else // assume we're on Mac
41#include <stdlib.h>
42#include <dirent.h>
43#endif
44
45//const string strInstallerVersion = "1.0";
46const bool SPLIT = 1;
47const bool NOT_SPLIT = 0;
48bool splitInstances = SPLIT;
49bool busy = 0;
50#ifdef WIN32
51const string strOniSplit = "Onisplit.exe";
52string strImportOption = "-import:nosep";
53const char* strClsCmd = "cls";
54const char* strPauseCmd = "PAUSE";
55#else // set up Mac equivalents since we're in Mac OS
56const string strOniSplit = "mono Onisplit.exe";
57string strImportOption = "-import:sep";
58const char* strClsCmd = "clear";
59const char* strPauseCmd = "read -n 1 -p \"Press any key to continue\"";
60void Sleep(int ms) { sleep( ms / 1000 ); }
61#endif
62
63using namespace boost::filesystem; 
64using namespace std;
65
66
67
68
69#include "boost/date_time/gregorian/gregorian.hpp"
70#include "boost/date_time/date_parsing.hpp"
71#include "boost/date_time/posix_time/posix_time.hpp"
72
73string escapePath(string input) {
74       
75        string output;
76        string escape_me = "& ;()|<>\"'\\#*?$";
77        for(int i = 0; i < input.size(); i++)  {
78                for(int j = 0; j < escape_me.size(); j++) if (input[i] == escape_me[j]) output += '//';
79                output += input[i];
80        }
81        return output;
82}
83
84int globalizeData(void)
85{
86        busy = 1;
87        using boost::lexical_cast;
88        using boost::bad_lexical_cast;
89        // using namespace boost::posix_time;
90        using namespace boost::gregorian;
91        using namespace boost::posix_time;
92        ptime start_time(second_clock::local_time());
93
94        setStatusArea("Globalizing!");
95        int err = 0;
96        int parts_done = 0;
97        char Step_x_x[300];
98        //char levels[i][5];
99        remove("Globalize.log");
100        ofstream logfile("Globalize.log");
101        logfile << "Globalization started " << to_simple_string(start_time) << endl;
102        try {
103
104                char levels_cstr[15][3] = {"0", "1", "2", "3", "4", "6", "8", "9", "10", "11", "12", "13", "14", "18", "19"}; // the levels Oni has...probably should have made a string array. Oops.
105                //const vector<double> ck(cv, &cv[CvSize]);
106                vector<string> levels;
107                for (int f = 0; f < 15; f++) {
108                        levels.push_back(levels_cstr[f]);
109                }
110                char choice = 0;
111
112                //SetCurrentDirectory("C:/Program Files/Oni/edition/install");
113                ///char levels[i][3];
114                path Characters = "../GameDataFolder/level0_Characters";
115                path Particles = "../GameDataFolder/level0_Particles";
116                path Archive = "../GameDataFolder/Archive";
117                path Textures  = "../GameDataFolder/level0_Textures";
118                path Sounds = "../GameDataFolder/level0_Sounds";
119                path Animations = "../GameDataFolder/level0_Animations";
120                path TRAC = Animations / "level0_TRAC";
121                path TRAM = Animations / "level0_TRAM";
122
123                vector<path> GDFPaths;
124                GDFPaths.push_back(Characters);
125                GDFPaths.push_back(Particles);
126                GDFPaths.push_back(Textures);
127                GDFPaths.push_back(Sounds);
128                GDFPaths.push_back(TRAC);
129                GDFPaths.push_back(TRAM);
130
131
132                path VanillaCharacters = "packages/VanillaDats/level0_Final/level0_Characters/level0_Characters.oni";
133                path VanillaParticles = "packages/VanillaDats/level0_Final/level0_Particles/level0_Particles.oni";
134                path VanillaTextures  = "packages/VanillaDats/level0_Final/level0_Textures/level0_Textures.oni";
135                path VanillaSounds = "packages/VanillaDats/level0_Final/level0_Sounds/level0_Sounds.oni";
136                path VanillaAnimations = "packages/VanillaDats/level0_Final/level0_Animations/level0_Animations.oni";
137                path VanillaTRAC = "packages/VanillaDats/level0_Final/level0_Animations/level0_TRAC.oni";
138                path VanillaTRAM = "packages/VanillaDats/level0_Final/level0_Animations/level0_TRAM.oni";
139
140                vector<path> VanillaPaths;
141
142                VanillaPaths.push_back(VanillaCharacters);
143                VanillaPaths.push_back(VanillaParticles);
144                VanillaPaths.push_back(VanillaTextures);
145                VanillaPaths.push_back(VanillaSounds);
146                VanillaPaths.push_back(VanillaTRAC);
147                VanillaPaths.push_back(VanillaTRAM);
148
149                /*
150                if (exists("../GameDataFolder/"))
151                {
152                //cout << "\nIt looks like you've already globalized Oni's data.\nDo you want to re-globalize?\n(This will erase existing mods installed to the AE's game data.)"
153                //       << "\n1. Re-globalize"
154                //       << "\n2. Return to main menu\n";
155                //choice = cin.get();
156                cin.ignore(128, '\n');
157                if (choice == '1')
158                remove_all("../GameDataFolder"); // remove AE GDF
159                if (choice == '2')
160                return 0;
161                }
162                */
163                setStatusArea("Removing old GameDataFolder...\n");
164                logfile <<  "Removing old GameDataFolder...\n";
165                remove_all( "../GameDataFolder/" );
166                setStatusArea("Creating needed directories...");
167                logfile <<  "Creating needed directories...\n";
168                create_directory( "../GameDataFolder/" );
169
170                create_directory( "packages" );
171
172                if (exists("packages/VanillaDats")) remove_all("packages/VanillaDats"); 
173                create_directory( "packages/VanillaDats" );
174                create_directory( "packages/VanillaDats/level0_Final/" );
175                //blah blah finish this.
176                //logfile <<  "packages/VanillaDats/level0_Final/ created";
177                create_directory( Characters );
178                create_directory( Particles );
179                create_directory( Archive );
180                create_directory( Textures );
181                create_directory( Sounds );
182                create_directory( Animations );
183                create_directory( TRAC );
184                create_directory( TRAM );
185                int num_levels = 0;
186                for(int i = 1; i < 15; i++)
187                {
188                        if (exists("../../GameDataFolder/level" + levels[i] + "_Final.dat")) {
189                                num_levels++;
190
191                        }
192                }
193                logfile << "Exporting and moving...\n\n";
194                int total_steps =  8 + 2 * num_levels;
195                for(int i = 0; i < 15; i++)
196                {
197
198                        //printf(levels[i],"%d",levels[i]); // int to char array
199
200                        if (exists("../../GameDataFolder/level" + levels[i] + "_Final.dat")) {
201                                logfile << "level" << levels[i] << "_Final\n";
202                                logfile << "\tExporting level" << levels[i] << "_Final.dat\n";
203                                //printf(Step_x_x,"Step %d/%d: exporting level%d_final.dat", parts_done + 1,, levels[i]); setStatusArea((string)Step_x_x);
204                                setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + " exporting level" + levels[i]+"_Final.dat");
205                                create_directory( "../GameDataFolder/level" + levels[i] + "_Final" ); 
206                                //                              setStatusArea(strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat");
207                                system((strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat").c_str());
208                                create_directory( "packages/VanillaDats/level" + levels[i] + "_Final" ); 
209                                create_directory( "packages/VanillaDats/level" + levels[i] + "_Final/level" + levels[i] + "_Final" );
210
211                                directory_iterator end_iter;
212                                for ( directory_iterator dir_itr( "../GameDataFolder/level" + levels[i] + "_Final" ); dir_itr != end_iter; ++dir_itr )
213                                {
214                                        //cout << dir_itr->path().filename();
215                                        if ( is_regular_file( dir_itr->status() ) )
216                                        {
217                                                if ( dir_itr->path().filename().substr(0,8) == "TXMPfail" || 
218                                                        dir_itr->path().filename().substr(0,9) == "TXMPlevel" ||
219                                                        ( dir_itr->path().filename().substr(0,4) == "TXMP" && dir_itr->path().filename().find("intro")!=string::npos) ||
220                                                        dir_itr->path().filename().substr(0,4) == "TXMB" || 
221                                                        dir_itr->path().filename() == "M3GMpowerup_lsi.oni" ||
222                                                        dir_itr->path().filename() == "TXMPlsi_icon.oni" ||
223                                                        ( dir_itr->path().filename().substr(0,4) == "TXMB" && dir_itr->path().filename().find("splash_screen.oni")!=string::npos)       )
224                                                {
225                                                        cout <<dir_itr->path().filename() << "\n";
226                                                        create_directory( dir_itr->path().parent_path() / "NoGlobal"); 
227                                                        if(!exists( dir_itr->path().parent_path() / "NoGlobal" / dir_itr->filename())) rename(dir_itr->path(), dir_itr->path().parent_path() / "NoGlobal" /
228                                                                dir_itr->filename());
229                                                        else remove(dir_itr->path());
230                                                }
231                                                else if (dir_itr->path().filename().substr(0,4) == "TRAC"
232                                                        || dir_itr->path().filename().substr(0,4) == "ONVL") {
233                                                                cout <<dir_itr->path().filename() << "\n";
234                                                                if(!exists( TRAC / dir_itr->filename())) rename(dir_itr->path(), TRAC / dir_itr->filename());
235                                                                else remove(dir_itr->path());
236                                                }
237                                                else if (dir_itr->path().filename().substr(0,4) == "TRAM") {
238                                                        cout <<dir_itr->path().filename() << "\n";
239                                                        if(!exists( TRAM / dir_itr->filename())) rename(dir_itr->path(), TRAM / dir_itr->filename());
240                                                        else remove(dir_itr->path());
241                                                }
242                                                else if (dir_itr->path().filename().substr(0,4) == "ONSK" ||
243                                                        dir_itr->path().filename().substr(0,4) == "TXMP") {
244                                                                cout <<dir_itr->path().filename() << "\n";\
245                                                                        create_directory( dir_itr->path().parent_path() / "TexFix");   
246                                                                if(!exists( Textures / dir_itr->filename())) rename(dir_itr->path(), Textures / dir_itr->filename());
247                                                                //rename(dir_itr->path(), dir_itr->path().parent_path() / "TexFix" / dir_itr->filename());
248                                                }
249                                                else if (dir_itr->path().filename().substr(0,4) == "ONCC" 
250                                                        || dir_itr->path().filename().substr(0,4) == "TRBS"
251                                                        || dir_itr->path().filename().substr(0,4) == "ONCV"
252                                                        || dir_itr->path().filename().substr(0,4) == "TRMA"
253                                                        || dir_itr->path().filename().substr(0,4) == "TRSC"
254                                                        || dir_itr->path().filename().substr(0,4) == "TRAS") {
255                                                                cout <<dir_itr->path().filename() << "\n";
256                                                                if(!exists( Characters / dir_itr->filename())) rename(dir_itr->path(), Characters / dir_itr->filename());
257                                                                else remove(dir_itr->path());
258                                                }
259                                                else if (dir_itr->path().filename().substr(0,4) == "OSBD"
260                                                        || dir_itr->path().filename().substr(0,4) == "SNDD") {
261                                                                cout << dir_itr->path().filename() << "\n";
262                                                                if(!exists( Sounds / dir_itr->filename())) rename(dir_itr->path(), Sounds / dir_itr->filename());
263                                                                else remove(dir_itr->path());
264                                                }
265                                                else if (dir_itr->path().filename().substr(0,5) == "BINA3"
266                                                        || dir_itr->path().filename().substr(0,10) == "M3GMdebris"
267                                                        || dir_itr->path().filename() == "M3GMtoxic_bubble.oni"
268                                                        || dir_itr->path().filename().substr(0,8) == "M3GMelec"
269                                                        || dir_itr->path().filename().substr(0,7) == "M3GMrat"
270                                                        || dir_itr->path().filename().substr(0,7) == "M3GMjet"
271                                                        || dir_itr->path().filename().substr(0,9) == "M3GMbomb_"
272                                                        || dir_itr->path().filename() == "M3GMbarab_swave.oni"
273                                                        || dir_itr->path().filename() == "M3GMbloodyfoot.oni"
274                                                        ){
275                                                                cout <<dir_itr->path().filename() << "\n";
276                                                                if(!exists( Particles / dir_itr->filename())) rename(dir_itr->path(), Particles / dir_itr->filename());
277                                                                else remove(dir_itr->path());
278                                                }
279                                                else if (dir_itr->path().filename().substr(0,4) == "AGDB"
280                                                        || dir_itr->path().filename().substr(0,4) == "TRCM") {
281                                                                cout <<dir_itr->path().filename() << "\n";
282
283                                                                if(!exists( Archive / dir_itr->filename())) rename(dir_itr->path(), Archive / dir_itr->filename());
284                                                                else remove(dir_itr->path());
285                                                }
286                                                else if (dir_itr->path().filename().substr(0,4) == "ONWC") { //fix for buggy ONWC overriding
287                                                                cout <<dir_itr->path().filename() << "\n";
288
289                                                                if(!exists( "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());
290                                                                else remove(dir_itr->path());
291                                                }
292                                                if (exists(dir_itr->path())) {
293
294                                                }
295                                                else {
296                                                        //logfile << "\tMoved file: " << dir_itr->path().filename() << "\n";
297                                                }
298                                        }
299
300
301
302                                }
303                                logfile << "\tCleaning up TXMPs...\n";
304                                system( (strOniSplit + " -move:delete " + Textures.string() + " ../GameDataFolder/level" + levels[i] + "_Final/TXMP*.oni").c_str());
305                                parts_done++;
306
307                                setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) )); 
308
309                        }
310                }
311                logfile << "Reimporting levels\n";
312                for (int i = 0; i < 15; i++)
313                {
314                        logfile << "\tReimporting level" << levels[i] << "_Final.oni\n";
315                        //printf(levels[i],"%d",levels[i]);
316                        //printf(Step_x_x,"Step %d/%d: reimporting level", parts_done + 1, 7 + 2 * num_levels); setStatusArea((string)Step_x_x + levels[i] + (string)"_Final.dat");
317                        setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + " reimporting level" + levels[i]+"_Final.oni");
318                        logfile << (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level" 
319                                + levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize.log").c_str() << '\n';
320                        string sys_str = (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level"
321                                + levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize.log");
322                                system(sys_str.c_str() );
323                        setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) ));
324                        parts_done++;
325                }
326                create_directory( VanillaCharacters.parent_path() );
327                create_directory( VanillaParticles.parent_path() );
328                create_directory( VanillaTextures.parent_path() );
329                create_directory( VanillaSounds.parent_path() );
330                create_directory( VanillaAnimations.remove_filename() );
331
332                for(int j = 0; j < GDFPaths.size(); j++) {
333                        logfile << "\tReimporting " << GDFPaths[j].filename() << ".oni\n";
334                        setStatusArea("Step " + lexical_cast<std::string>(parts_done + 1) + "/" + lexical_cast<std::string>(total_steps) + ": reimporting " + GDFPaths[j].filename() );
335                        system((strOniSplit + " " + strImportOption + " " + GDFPaths[j].string() + " " + VanillaPaths[j].string()).c_str());
336                        parts_done++;
337                        setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) )); 
338                }
339                /*
340                printf(Step_x_x,"Step %d/%d: reimporting level0_Characters", parts_done,7 + 2 * num_levels); setStatusArea((string)Step_x_x);setProgressBar( (int)(1000 * (float)(parts_done) / (float)(7 + 2 * num_levels) ));
341                system((strOniSplit + " " + strImportOption + " " + Characters.string() + " " + VanillaCharacters.string()).c_str());
342                parts_done++; printf(Step_x_x,"Step %d/%d: reimporting level0_Particles", parts_done,7 + 2 * num_levels); setStatusArea((string)Step_x_x);setProgressBar( (int)(1000 * (float)(parts_done) / (float)(7 + 2 * num_levels) ));
343                system((strOniSplit + " " + strImportOption + " " + Particles.string() + " " + VanillaParticles.string()).c_str());
344                parts_done++; printf(Step_x_x,"Step %d/%d: reimporting level0_Textures", parts_done,7 + 2 * num_levels); setStatusArea((string)Step_x_x);setProgressBar( (int)(1000 * (float)(parts_done) / (float)(7 + 2 * num_levels) ));
345                system((strOniSplit + " " + strImportOption + " " + Textures.string() + " " + VanillaTextures.string()).c_str());
346                //system((strOniSplit   + " " + strImportOption + (string)" " + Animations.string() + (string)" " + VanillaAnimations.string()).c_str());
347                parts_done++; printf(Step_x_x,"Step %d/%d: reimporting level0_TRAC", parts_done,7 + 2 * num_levels); setStatusArea((string)Step_x_x);setProgressBar( (int)(1000 * (float)(parts_done) / (float)(7 + 2 * num_levels) ));
348                system((strOniSplit + " " + strImportOption + " " + TRAC.string() + " " + VanillaTRAC.string()).c_str());
349                parts_done++; printf(Step_x_x,"Step %d/%d: reimporting level0_Sounds", parts_done,7 + 2 * num_levels); setStatusArea((string)Step_x_x);setProgressBar( (int)(1000 * (float)(parts_done) / (float)(7 + 2 * num_levels) ));
350                system((strOniSplit + " " + strImportOption + " " + Sounds.string() + " " + VanillaSounds.string()).c_str());
351                parts_done++; printf(Step_x_x,"Step %d/%d: reimporting level0_TRAM", parts_done,7 + 2 * num_levels); setStatusArea((string)Step_x_x);setProgressBar( (int)(1000 * (float)(parts_done) / (float)(7 + 2 * num_levels) ));
352                system((strOniSplit + " " + strImportOption + " " + TRAM.string() + " " + VanillaTRAM.string()).c_str());
353                //parts_done++; setStatusArea((string)"Copying level scripts...");setProgressBar( (int)(1000 * (float)(parts_done) / (float)(7 + 2 * num_levels) ));
354                if (exists("../GameDataFolder/IGMD")) remove_all("../GameDataFolder/IGMD");
355                */
356                create_directory((path)"../GameDataFolder/IGMD");
357                copy((path)"packages/VanillaBSL/IGMD", (path)"../GameDataFolder");
358                setProgressBar( 1000 );
359               
360                // 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/
361                // or we could just include it in the zip in the proper place already.
362
363                copy("../../persist.dat","../persist.dat");
364                copy("../../keyconfig.txt","../keyconfig.txt"); 
365#ifndef WIN32
366                /* On Mac only, set the current GDF to the AE GDF by writing to Oni's global preferences file (thankfully a standard OS X ".plist" XML file).
367                   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,
368                   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 */
369                path fullAEpath = system_complete("."); // get full path for Installer
370                char prefsCommand[300] = "defaults write com.godgames.oni RetailInstallationPath -string '";
371                strcat(prefsCommand, fullAEpath.parent_path().parent_path().string().c_str()); // get path of edition/ folder (Oni wants the folder that *contains* the GDF)
372                strcat(prefsCommand, "'"); // path string is enclosed in single quotes to avoid the need to escape UNIX-unfriendly characters
373                system(prefsCommand);
374               
375#endif
376               
377               
378                setStatusArea((string)"Done! Now select your mod packages and click install.");
379                //      while(1) Sleep(-1);
380
381        }
382        catch (exception ex) {
383                setStatusArea("Warning, handled exception: " + (string)ex.what());
384        }
385
386        ptime end_time(second_clock::local_time());
387        time_period total_time (start_time, end_time);
388        logfile << "\n\nGlobalization ended " << to_simple_string(end_time) << "\nThe process took " << total_time.length();
389        //total_time.length().hours();
390        logfile.close();
391        busy = 0;
392        return err;
393}
394
395
396vector<ModPackage> getPackages(void)
397{
398        vector<ModPackage> packages;
399        packages.reserve(65536); // come on, we shouldn't need this much space...right?!
400        fstream file;
401        string filename = "\0";
402        string MODINFO_CFG = "Mod_Info.cfg";
403
404        try
405        {
406                directory_iterator end_iter;
407                for (directory_iterator dir_itr("./packages"); dir_itr != end_iter; ++dir_itr)
408                {
409                        file.open((dir_itr->path().string() + "/" + MODINFO_CFG).c_str());
410                        //cout << filename << "\n";
411
412                        if(!file.fail())
413                        {
414                                //cout << dir_itr->path().string() + MODINFO_CFG;
415                                //would prefer to push a pointer to a package, but this will do for now
416                                packages.push_back(fileToModPackage(file));
417                        }       
418                        file.close();
419                        file.clear();
420                }
421                sort(packages.begin(), packages.end());
422        }
423        catch (const std::exception & ex)
424        {
425                cout << "Warning, something odd happened!\n";
426        }
427
428        return packages;
429}
430
431ModPackage fileToModPackage(fstream &file)
432{
433        /*
434        This converts a file to a ModPackage struct.
435
436        A few notes...
437        "iter" is the current word we are on. I should have named it "token" or something, but I don't have multiple iterators, so its ok.
438        I refer to (*iter) at the beginning of each if statement block. I could probably store it as a variable, but I'm pretty sure that dereferencing a pointer\iterator isn't much
439        slower than reading a variable.
440        */
441        ModPackage package;
442        string line;
443        static string NameOfMod = "NameOfMod";  //used for comparing to the current token...
444        //I could have done it in reverse (*iter).compare("ModString") or 
445        static string ARROW = "->";                             //did something like "ModString".compare(*iter), and it would have been
446        static string ModString = "ModString";  //functionably the same.
447        static string HasOnis = "HasOnis";
448        static string HasDeltas = "HasDeltas";
449        static string HasBSL = "HasBSL";
450        static string HasDats = "HasDats";
451        static string IsEngine = "IsEngine";
452        static string Readme = "Readme";
453        static string GlobalNeeded = "GlobalNeeded";
454        static string Category = "Category";
455        static string Creator = "Creator";
456        while (! file.eof() )
457        {
458                getline (file,line);
459                vector<string> tokens; 
460                vector<string>::iterator iter;
461                tokenize(line, tokens);                                 //string to vector of "words"
462                if (tokens.capacity() >= 2) {                   //make sure they are using enough stuff
463                        iter = tokens.begin();                          //what word we are on, starts at first word
464                        /*
465                        if (!AEInstallVersion.compare(*iter))
466                        If mod is too old, skip this mod.
467                        */
468                        /*else*/if (!NameOfMod.compare(*iter))  {       //if it contains the name
469                                for ( ; iter !=tokens.end() && SLASHSLASH.compare(*iter); iter++) {     //interates through the words, ends if it reaches the end of the line or a "//" comment
470                                        if (ARROW.compare(*iter) && NameOfMod.compare(*iter)) {                 //ignores "->" and "NameOfMod"
471                                                //cout << *iter;
472                                                //cout << " ";
473                                                package.name += *iter + " ";
474                                        }
475                                }
476
477                        }
478                        else if (!ModString.compare(*iter)) {
479                                iter++; iter++;
480                                package.modStringName = *iter;
481                                iter++;
482                                package.modStringVersion = atoi((*iter).c_str());
483                        }
484                        else if (!HasOnis.compare(*iter)) {
485                                iter++; iter++; 
486                                if (toupper((*iter)[0]) + toupper((*iter)[1]) + toupper((*iter)[2]) == 'Y' + 'E' + 'S') package.hasOnis = 1; //Gotta love c++'s lack of a standard case-insensitive
487                                else if (!HasBSL.compare(*iter)) { // string comparer...I know my implementation here sucks. I need to change it to check each character one by one. At the moment,
488                                        iter++; iter++;}  // using "YFR" would probably set it off. :<
489
490                                if (toupper((*iter)[0]) + toupper((*iter)[1]) + toupper((*iter)[2]) == 'Y' + 'E' + 'S') package.hasBSL = 1;
491                        }
492                        else if (!HasDeltas.compare(*iter)) {
493                                iter++; iter++; 
494                                if (toupper((*iter)[0]) + toupper((*iter)[1]) + toupper((*iter)[2]) == 'Y' + 'E' + 'S') package.hasDeltas = 1;
495                        }
496                        else if (!HasDats.compare(*iter)) {
497                                iter++; iter++; 
498                                if (toupper((*iter)[0]) + toupper((*iter)[1]) + toupper((*iter)[2]) == 'Y' + 'E' + 'S') package.hasDats = 1;
499                        }
500                        else if (!IsEngine.compare(*iter)) {
501                                iter++; iter++; 
502                                if (toupper((*iter)[0]) + toupper((*iter)[1]) + toupper((*iter)[2]) == 'Y' + 'E' + 'S') package.isEngine = 1;
503                        }
504                        else if (!GlobalNeeded.compare(*iter)) {
505                                iter++; iter++; 
506                                if (toupper((*iter)[0]) + toupper((*iter)[1]) + toupper((*iter)[2]) == 'Y' + 'E' + 'S') package.globalNeeded = 1;
507                                else if (toupper((*iter)[0]) + toupper((*iter)[1]) == 'N' + 'O') package.globalNeeded = 1; //Really the only place where checking for "No" is important atm.
508                        }
509                        else if (!Category.compare(*iter))  {   
510                                for ( ; iter !=tokens.end() && SLASHSLASH.compare(*iter); iter++) {     //interates through the words, ends if it reaches the end of the line or a "//" comment
511                                        if (ARROW.compare(*iter) && Category.compare(*iter)) {                  //ignores "->" and "Category"
512                                                //cout << *iter;
513                                                //cout << " ";
514                                                package.category += *iter + " ";
515                                        }
516                                }
517                        }
518                        else if (!Creator.compare(*iter))  {    //if it contains the name
519                                for ( ; iter !=tokens.end() && SLASHSLASH.compare(*iter); iter++) {     //interates through the words, ends if it reaches the end of the line or a "//" comment
520                                        if (ARROW.compare(*iter) && Creator.compare(*iter)) {                   //ignores "->" and "Category"
521                                                //cout << *iter;
522                                                //cout << " ";
523                                                package.creator += *iter + " ";
524                                        }
525                                }
526                        }
527                        else if (!Readme.compare(*iter))  {     //if it contains the name
528                                for ( ; iter !=tokens.end() && SLASHSLASH.compare(*iter); iter++) {     //interates through the words, ends if it reaches the end of the line or a "//" comment
529                                        if (ARROW.compare(*iter) && Readme.compare(*iter)) {                    //ignores "->" and "Category"
530                                                if(!(*iter).compare("\\n")) package.readme += '\n';
531                                                else package.readme += *iter + " ";
532                                        }
533                                }
534                        }
535                }
536
537        }
538        package.doOutput();
539        return package;
540}
541
542void recompileAll(vector<string> installedMods)
543{
544        busy = 1;
545        using namespace boost::gregorian;
546        using namespace boost::posix_time;
547        using boost::lexical_cast;
548        using boost::bad_lexical_cast;
549       
550        setStatusArea("Importing levels...");
551        //setStatusArea("Recompiling Data...");
552        path vanilla_dir = "./packages/VanillaDats/";
553        string importCommand = "";
554        char statusString[128];
555        int numberOfDats = 0;
556        int j = 1;
557        string datString;
558        std::stringstream out;
559
560        ptime start_time(second_clock::local_time());
561        clearOldDats();
562        remove("Install.log");
563        ofstream logfile("Install.log");
564        logfile << "Mod Installation started " << to_simple_string(start_time) << endl;
565        logfile.close();
566        if(splitInstances == SPLIT){
567                recursive_directory_iterator end_iter;
568
569                for ( recursive_directory_iterator dir_itr( vanilla_dir );
570                        dir_itr != end_iter;
571                        ++dir_itr )
572                {
573                        try{
574                                if ( is_directory( dir_itr->status() ) &&  dir_itr.level() == 1)
575                                {
576                                        numberOfDats++;
577                                }
578                        }
579                        catch(exception ex) {
580
581                        }
582                }
583
584                //recursive_directory_iterator end_iter;
585
586
587                out << numberOfDats;
588                datString = out.str();
589                try {
590                        for ( recursive_directory_iterator dir_itr( vanilla_dir );
591                                dir_itr != end_iter;
592                                ++dir_itr )
593                        {
594                                try
595                                {
596                                        if ( is_directory( dir_itr->status() ) &&  dir_itr.level() == 1)
597                                        {
598                                                importCommand = strOniSplit + " " + strImportOption + " " + dir_itr->path().parent_path().string() + '/' + dir_itr->path().filename();
599                                                for (int i = 0; i < installedMods.size(); ++i) {
600                                                        if (exists("packages/" + installedMods[i] + "/oni/" + dir_itr->path().parent_path().filename() + '/' + dir_itr->path().filename()  ))
601                                                                importCommand += " packages/" + installedMods[i] + "/oni/" + dir_itr->path().parent_path().filename() + '/' + dir_itr->path().filename();
602
603                                                        //else cout << " packages/VanillaDats/" + installedMods[i] + "/oni/";
604                                                }
605                                                importCommand += " ../GameDataFolder/" + dir_itr->path().filename() + ".dat >> Install.log";
606
607                                               
608                                                setProgressBar( (int)(1000 * (float)(j-1) / (float)numberOfDats) ); //100% * dat we're on / total dats
609                                                setStatusArea("Step " + lexical_cast<std::string>(j) + '/' + lexical_cast<std::string>(numberOfDats)+ ": Importing " +  dir_itr->path().filename() + " ");
610
611                                                system(importCommand.c_str());
612                                                //Sleep(1000);
613                                                //cout << importCommand << "\n";
614                                                j++;
615
616                                        }
617                                }
618                                catch ( const std::exception & ex )
619                                {
620
621                                        remove("Install.log");
622                                        ofstream logfile("Install.log");
623
624
625                                        logfile << "Warning, exception " << ex.what() << "!";
626                                        setStatusArea("Warning, exception " + (string)ex.what() + "!");
627                                        logfile.close();       
628                                }
629                        }
630
631                }
632                catch( const std::exception & ex ) {
633
634                        remove("Install.log");
635                        ofstream logfile("Install.log");
636
637
638                        logfile << "Warning, exception " << ex.what() << "!";
639                        setStatusArea("Warning, exception " + (string)ex.what() + "!");
640                        logfile.close();
641                }
642
643        }
644        else if(splitInstances == NOT_SPLIT){
645                directory_iterator end_iter;
646
647                for ( directory_iterator dir_itr( vanilla_dir );
648                        dir_itr != end_iter;
649                        ++dir_itr )
650                {
651
652                        if ( is_directory( dir_itr->status() ) )
653                        {
654                                numberOfDats++;
655                        }
656
657
658                }
659
660                out << numberOfDats;
661                datString = out.str();
662
663                for ( directory_iterator dir_itr( vanilla_dir );
664                        dir_itr != end_iter;
665                        ++dir_itr )
666                {
667                        try
668                        {
669                                if ( is_directory( dir_itr->status() ) )
670                                {
671                                        importCommand = strOniSplit + " " + strImportOption + " " + vanilla_dir.string() + dir_itr->path().filename() + " ";
672                                        for (int i = 0; i < installedMods.size(); ++i) {
673                                                if (exists("packages/" + installedMods[i] + "/oni/" + dir_itr->path().filename()  ))
674                                                        importCommand += " packages/" + installedMods[i] + "/oni/" + dir_itr->path().filename();
675                                        }
676                                        importCommand += " ../GameDataFolder/" + dir_itr->path().filename() + ".dat >> Install.log";
677
678
679                                        setProgressBar( (int)(1000 * (float)(j-1) / (float)numberOfDats) ); //100% * dat we're on / total dats
680                                        setStatusArea("Step " + lexical_cast<std::string>(j) + '/' + lexical_cast<std::string>(numberOfDats)+ ": Importing " +  dir_itr->path().filename() + " ");
681
682                                        system(importCommand.c_str());
683
684                                        j++;
685                                }
686                        }
687                        catch ( const std::exception & ex )
688                        {
689
690                                remove("Install.log");
691                                ofstream logfile("Install.log");
692
693
694                                logfile << "Warning, exception " << ex.what() << "!";
695                                setStatusArea("Warning, exception " + (string)ex.what() + "!");
696                                logfile.close();
697                        }}
698        }
699        logfile << "Writing config file";
700        writeInstalledMods(installedMods);
701        setProgressBar(1000);
702        setStatusArea("Done! You can now play Oni.");
703
704        ptime end_time(second_clock::local_time());
705        time_period total_time (start_time, end_time);
706
707
708        ofstream logfile2("Install.log", ios::app | ios::ate);
709        string outstring = (string)"\n\nGlobalization ended " + to_simple_string(end_time) + "\nThe process took ";// + (string)total_time.length();
710
711        logfile2 << "\nGlobalization ended " << to_simple_string(end_time) << "\nThe process took " << total_time.length();
712
713        //logfile2.write(outstring.c_str(), outstring.length());
714        logfile2.close();
715
716        //total_time.length().hours();
717
718        Sleep(1000);
719        setProgressBar(0);
720        busy = 0;
721}
722
723void writeInstalledMods(vector<string> installedMods)
724{
725
726        if ( exists( strInstallCfg ) )
727        {
728                remove( strInstallCfg );
729        }
730
731        ofstream file(strInstallCfg.c_str());
732
733        vector<string>list = installedMods;
734        vector<string>::iterator begin_iter = list.begin(); 
735        vector<string>::iterator end_iter = list.end();
736
737        sort( list.begin(), list.end() );
738
739        for( ; begin_iter != end_iter; ++begin_iter) {
740                file << *begin_iter << " ";
741        }
742
743        file.close();
744        file.clear();
745
746}
747
748vector<string> getInstallString(string Cfg)
749{
750        //system(strPauseCmd);
751        vector<string> returnval;
752
753        string line;
754        fstream file;
755
756        if (exists( Cfg ))
757        {
758                file.open(Cfg.c_str());
759                getline(file, line);
760                tokenize(line, returnval);
761                file.close();
762                file.clear();
763                sort(returnval.begin(), returnval.end());
764        }
765        else cout << "fail";
766
767        return returnval;
768}
769
770//stolen token function...
771void tokenize(const string& str, vector<string>& tokens, const string& delimiters)
772{
773        // Skip delimiters at beginning.
774        string::size_type lastPos = str.find_first_not_of(delimiters, 0);
775        // Find first "non-delimiter".
776        string::size_type pos     = str.find_first_of(delimiters, lastPos);
777
778        while (string::npos != pos || string::npos != lastPos)
779        {
780                // Found a token, add it to the vector.
781                tokens.push_back(str.substr(lastPos, pos - lastPos));
782                // Skip delimiters.  Note the "not_of"
783                lastPos = str.find_first_not_of(delimiters, pos);
784                // Find next "non-delimiter"
785                pos = str.find_first_of(delimiters, lastPos);
786        }
787}
788
789void clearOldDats(void) {
790        directory_iterator end_iter_gdf;
791        for ( directory_iterator dir_itr_gdf( "../GameDataFolder" );
792                dir_itr_gdf != end_iter_gdf;
793                ++dir_itr_gdf )
794        {
795                //cout << dir_itr_gdf->path().extension() << "\n";
796                if ( dir_itr_gdf->path().extension() == ".dat" || dir_itr_gdf->path().extension() == ".raw" || dir_itr_gdf->path().extension() == ".sep" ) {
797                        remove( dir_itr_gdf->path() );
798                }
799
800        }
801
802}
803
804vector<string> globalInstalledMods;
805vector<ModPackage> globalPackages;
806#include "boost/thread.hpp"
807#include <boost/thread/mutex.hpp>
808
809/////////////////////////////////////////////////////////////////////////////
810// Name:        main_window.cpp
811// Purpose:     
812// Author:     
813// Modified by:
814// Created:     07/05/2009 20:38:25
815// RCS-ID:     
816// Copyright:   
817// Licence:     
818/////////////////////////////////////////////////////////////////////////////
819
820// For compilers that support precompilation, includes "wx/wx.h".
821#include "wx/wxprec.h"
822
823#ifdef __BORLANDC__
824#pragma hdrstop
825#endif
826
827#ifndef WX_PRECOMP
828#include "wx/wx.h"
829#endif
830
831////@begin includes
832#include "about.h"
833////@end includes
834
835#include "main_window.h"
836
837////@begin XPM images
838#include "aelogosmall.xpm"
839#include "undo.xpm"
840#include "fileopen.xpm"
841#include "filesaveas.xpm"
842#include "quit.xpm"
843////@end XPM images
844
845//#define wxDebug 1;
846//#define wxUSE_UNICODE 1;
847
848/*
849* MainWindow type definition
850*/
851
852IMPLEMENT_CLASS( MainWindow, wxFrame )
853
854
855/*
856* MainWindow event table definition
857*/
858
859BEGIN_EVENT_TABLE( MainWindow, wxFrame )
860
861////@begin MainWindow event table entries
862    EVT_CHECKBOX( SelectAll_Checkbox, MainWindow::OnSelectAllCheckboxClick )
863
864    EVT_BUTTON( Refresh_Button, MainWindow::OnRefreshButtonClick )
865
866    EVT_LISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Selected )
867    EVT_CHECKLISTBOX( Mods_CheckboxList1, MainWindow::OnModsCheckboxList1Toggled )
868
869    EVT_UPDATE_UI( ID_STATUSBAR, MainWindow::OnStatusbarUpdate )
870
871    EVT_BUTTON( Install_Button, MainWindow::OnInstallButtonClick )
872
873    EVT_RADIOBUTTON( Sep_RadioButton, MainWindow::OnSepRadioButtonSelected )
874
875    EVT_RADIOBUTTON( NoSep_RadioButton, MainWindow::OnNoSepRadioButtonSelected )
876
877    EVT_RADIOBUTTON( Seperated_RadioButton, MainWindow::OnSeperatedRadioButtonSelected )
878
879    EVT_RADIOBUTTON( Complete_RadioButton, MainWindow::OnCompleteRadioButtonSelected )
880
881    EVT_BUTTON( ReGlobalize_Button, MainWindow::OnReGlobalizeButtonClick )
882
883    EVT_MENU( wxID_LOAD, MainWindow::OnLoadClick )
884
885    EVT_MENU( wxID_SAVE, MainWindow::OnSaveClick )
886
887    EVT_MENU( wxID_EXIT, MainWindow::OnExitClick )
888
889    EVT_MENU( wxID_OPTIONS, MainWindow::OnOptionsClick )
890
891    EVT_MENU( wxID_ABOUT, MainWindow::OnAboutClick )
892
893////@end MainWindow event table entries
894
895END_EVENT_TABLE()
896
897
898/*
899* MainWindow constructors
900*/
901
902MainWindow::MainWindow()
903{
904        Init();
905}
906
907MainWindow::MainWindow( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
908{
909        Init();
910        Create( parent, id, caption, pos, size, style );
911}
912
913
914/*
915* MainWindow creator
916*/
917
918bool MainWindow::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
919{
920        ////@begin MainWindow creation
921    wxFrame::Create( parent, id, caption, pos, size, style );
922
923    CreateControls();
924    SetIcon(GetIconResource(wxT("aelogosmall.png")));
925    Centre();
926        ////@end MainWindow creation
927        return true;
928}
929
930
931/*
932* MainWindow destructor
933*/
934
935MainWindow::~MainWindow()
936{
937        ////@begin MainWindow destruction
938        ////@end MainWindow destruction
939}
940
941
942/*
943* Member initialisation
944*/
945
946void MainWindow::Init()
947{
948        ////@begin MainWindow member initialisation
949    MainSplitter = NULL;
950    SelectAll = NULL;
951    RefreshButton = NULL;
952    Mods_CheckboxList = NULL;
953    titleText = NULL;
954    creatorText = NULL;
955    descriptionText = NULL;
956    StatusArea = NULL;
957    ProgressBar = NULL;
958    InstallButton = NULL;
959    OptionsPanel = NULL;
960    SepRadio = NULL;
961    NoSepRadio = NULL;
962    SeperatedRadio = NULL;
963    CompleteRadio = NULL;
964    ReglobalizeButton = NULL;
965        ////@end MainWindow member initialisation
966
967}
968
969
970/*
971* Control creation for MainWindow
972*/
973wxStatusBar **TheStatusBar;
974wxButton* TheInstallButton;
975wxGauge* TheProgressBar;
976void MainWindow::CreateControls()
977{   
978        ////@begin MainWindow content construction
979    MainWindow* itemFrame1 = this;
980
981    wxMenuBar* menuBar = new wxMenuBar;
982    wxMenu* itemMenu37 = new wxMenu;
983    {
984        wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_LOAD, _("&Load Configuration..."), wxEmptyString, wxITEM_NORMAL);
985        wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("fileopen.xpm")));
986        menuItem->SetBitmap(bitmap);
987        itemMenu37->Append(menuItem);
988    }
989    {
990        wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_SAVE, _("&Save Configuration..."), wxEmptyString, wxITEM_NORMAL);
991        wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("filesaveas.xpm")));
992        menuItem->SetBitmap(bitmap);
993        itemMenu37->Append(menuItem);
994    }
995    itemMenu37->AppendSeparator();
996    {
997        wxMenuItem* menuItem = new wxMenuItem(itemMenu37, wxID_EXIT, _("Exit"), wxEmptyString, wxITEM_NORMAL);
998        wxBitmap bitmap(itemFrame1->GetBitmapResource(wxT("quit.xpm")));
999        menuItem->SetBitmap(bitmap);
1000        itemMenu37->Append(menuItem);
1001    }
1002    menuBar->Append(itemMenu37, _("&File"));
1003    wxMenu* itemMenu42 = new wxMenu;
1004    itemMenu42->Append(wxID_OPTIONS, _("Show Advanced Options..."), wxEmptyString, wxITEM_CHECK);
1005    menuBar->Append(itemMenu42, _("Options"));
1006    wxMenu* itemMenu44 = new wxMenu;
1007#ifdef WIN32
1008        itemMenu44->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
1009        menuBar->Append(itemMenu44, _("Help"));
1010#else
1011        itemMenu37->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
1012#endif 
1013
1014    itemFrame1->SetMenuBar(menuBar);
1015
1016    wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
1017    itemFrame1->SetSizer(itemBoxSizer2);
1018
1019    MainSplitter = new wxSplitterWindow( itemFrame1, ID_SPLITTERWINDOW, wxDefaultPosition, wxSize(100, 100), wxSP_LIVE_UPDATE|wxNO_BORDER );
1020    MainSplitter->SetMinimumPaneSize(1);
1021    MainSplitter->SetName(_T("MainSplitter"));
1022
1023    wxPanel* itemPanel4 = new wxPanel( MainSplitter, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1024    wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
1025    itemPanel4->SetSizer(itemBoxSizer5);
1026
1027    wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
1028    itemBoxSizer5->Add(itemBoxSizer6, 0, wxGROW|wxALL, 0);
1029    SelectAll = new wxCheckBox( itemPanel4, SelectAll_Checkbox, _("Select All/None"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE );
1030    SelectAll->SetValue(false);
1031    SelectAll->SetName(_T("SelectAll_Checkbox"));
1032    itemBoxSizer6->Add(SelectAll, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1033
1034    RefreshButton = new wxBitmapButton( itemPanel4, Refresh_Button, itemFrame1->GetBitmapResource(wxT("undo.xpm")), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
1035    RefreshButton->SetName(_T("RefreshButton"));
1036    itemBoxSizer6->Add(RefreshButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
1037
1038    wxArrayString Mods_CheckboxListStrings;
1039    Mods_CheckboxList = new wxCheckListBox( itemPanel4, Mods_CheckboxList1, wxDefaultPosition, wxDefaultSize, Mods_CheckboxListStrings, wxLB_HSCROLL );
1040    Mods_CheckboxList->SetName(_T("Mods_CheckboxList"));
1041    itemBoxSizer5->Add(Mods_CheckboxList, 1, wxGROW|wxALL, 0);
1042
1043    wxPanel* itemPanel10 = new wxPanel( MainSplitter, DescriptionHolder_Panel, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1044    itemPanel10->SetName(_T("DescriptionHolder_Panel"));
1045    wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL);
1046    itemPanel10->SetSizer(itemBoxSizer11);
1047
1048    wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
1049    itemBoxSizer11->Add(itemBoxSizer12, 0, wxGROW|wxALL, 0);
1050    wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL);
1051    itemBoxSizer12->Add(itemBoxSizer13, 1, wxALIGN_CENTER_VERTICAL|wxALL, 0);
1052    titleText = new wxTextCtrl( itemPanel10, Title_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
1053    titleText->SetName(_T("Title_Text"));
1054    titleText->SetBackgroundColour(wxColour(240, 240, 240));
1055    itemBoxSizer13->Add(titleText, 1, wxGROW|wxLEFT, 5);
1056
1057    wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxVERTICAL);
1058    itemBoxSizer12->Add(itemBoxSizer15, 1, wxGROW|wxALL, 0);
1059    creatorText = new wxTextCtrl( itemPanel10, Author_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_RIGHT );
1060    creatorText->SetName(_T("Author_Text"));
1061    creatorText->SetBackgroundColour(wxColour(240, 240, 240));
1062    itemBoxSizer15->Add(creatorText, 1, wxGROW|wxRIGHT, 5);
1063
1064    wxStaticLine* itemStaticLine17 = new wxStaticLine( itemPanel10, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
1065    itemStaticLine17->Show(false);
1066    itemBoxSizer11->Add(itemStaticLine17, 0, wxGROW|wxALL, 5);
1067
1068    descriptionText = new wxTextCtrl( itemPanel10, Description_Text, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH|wxTE_RICH2 );
1069    descriptionText->SetName(_T("DescriptionName"));
1070    descriptionText->SetBackgroundColour(wxColour(240, 240, 240));
1071    itemBoxSizer11->Add(descriptionText, 1, wxGROW|wxLEFT|wxRIGHT, 5);
1072
1073    MainSplitter->SplitVertically(itemPanel4, itemPanel10, 200);
1074    itemBoxSizer2->Add(MainSplitter, 1, wxGROW|wxALL, 0);
1075
1076    StatusArea = new wxStatusBar( itemFrame1, ID_STATUSBAR, 0 );
1077    StatusArea->SetName(_T("StatusArea"));
1078    StatusArea->SetFieldsCount(1);
1079    StatusArea->SetStatusText(_("AE Installer v1.0"), 0);
1080    itemBoxSizer2->Add(StatusArea, 0, wxGROW|wxALL, 0);
1081
1082    wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL);
1083    itemBoxSizer2->Add(itemBoxSizer20, 0, wxGROW|wxALL, 0);
1084
1085    ProgressBar = new wxGauge( itemFrame1, ProgressBar_Gauge, 1000, wxDefaultPosition, wxDefaultSize, wxGA_SMOOTH );
1086    ProgressBar->SetValue(0);
1087    itemBoxSizer20->Add(ProgressBar, 1, wxGROW|wxALL, 0);
1088
1089    InstallButton = new wxButton( itemFrame1, Install_Button, _("Install!"), wxDefaultPosition, wxDefaultSize, 0 );
1090    itemBoxSizer20->Add(InstallButton, 0, wxGROW|wxALL, 0);
1091
1092    wxBoxSizer* itemBoxSizer23 = new wxBoxSizer(wxVERTICAL);
1093    itemBoxSizer2->Add(itemBoxSizer23, 0, wxGROW|wxALL, 0);
1094
1095    OptionsPanel = new wxPanel( itemFrame1, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
1096    itemBoxSizer2->Add(OptionsPanel, 0, wxGROW, 0);
1097
1098    wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxHORIZONTAL);
1099    OptionsPanel->SetSizer(itemBoxSizer25);
1100
1101    wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxVERTICAL);
1102    itemBoxSizer25->Add(itemBoxSizer26, 0, wxGROW|wxALL, 5);
1103
1104    SepRadio = new wxRadioButton( OptionsPanel, Sep_RadioButton, _("Sep"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1105    SepRadio->SetValue(false);
1106    if (MainWindow::ShowToolTips())
1107        SepRadio->SetToolTip(_("For PC Demo and Mac"));
1108    itemBoxSizer26->Add(SepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1109
1110    NoSepRadio = new wxRadioButton( OptionsPanel, NoSep_RadioButton, _("NoSep"), wxDefaultPosition, wxDefaultSize, 0 );
1111    NoSepRadio->SetValue(false);
1112    if (MainWindow::ShowToolTips())
1113        NoSepRadio->SetToolTip(_("For PC Retail"));
1114    itemBoxSizer26->Add(NoSepRadio, 0, wxALIGN_LEFT|wxALL, 5);
1115
1116    wxStaticLine* itemStaticLine29 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1117    itemBoxSizer25->Add(itemStaticLine29, 0, wxGROW|wxALL, 5);
1118
1119    wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxVERTICAL);
1120    itemBoxSizer25->Add(itemBoxSizer30, 0, wxGROW|wxALL, 5);
1121
1122    SeperatedRadio = new wxRadioButton( OptionsPanel, Seperated_RadioButton, _("Separated Level0"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
1123    SeperatedRadio->SetValue(false);
1124    SeperatedRadio->SetName(_T("Seperated_RadioButton"));
1125    itemBoxSizer30->Add(SeperatedRadio, 0, wxALIGN_LEFT|wxALL, 5);
1126
1127    CompleteRadio = new wxRadioButton( OptionsPanel, Complete_RadioButton, _("Complete Level0"), wxDefaultPosition, wxDefaultSize, 0 );
1128    CompleteRadio->SetValue(false);
1129    CompleteRadio->SetName(_T("Complete_RadioButton"));
1130    itemBoxSizer30->Add(CompleteRadio, 0, wxALIGN_LEFT|wxALL, 5);
1131
1132    wxStaticLine* itemStaticLine33 = new wxStaticLine( OptionsPanel, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
1133    itemBoxSizer25->Add(itemStaticLine33, 0, wxGROW|wxALL, 5);
1134
1135    wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxVERTICAL);
1136    itemBoxSizer25->Add(itemBoxSizer34, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1137
1138    ReglobalizeButton = new wxButton( OptionsPanel, ReGlobalize_Button, _("Reglobalize"), wxDefaultPosition, wxDefaultSize, 0 );
1139    ReglobalizeButton->SetName(_T("Reglobalize_Button"));
1140    itemBoxSizer34->Add(ReglobalizeButton, 0, wxGROW|wxALL, 5);
1141
1142    // Connect events and objects
1143    Mods_CheckboxList->Connect(Mods_CheckboxList1, wxEVT_CREATE, wxWindowCreateEventHandler(MainWindow::ModList_OnCreate), NULL, this);
1144        ////@end MainWindow content construction
1145
1146        Handle = (HWND)GetHWND();
1147        ::CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_ITaskbarList, (void **)&pTaskbarList);
1148
1149
1150        if ( exists( "../../GameDataFolder/level0_Final.sep" ) ) {
1151                strImportOption = "-import:sep";
1152                splitInstances = NOT_SPLIT;
1153        }
1154        else {
1155                strImportOption = "-import:nosep";
1156                splitInstances = SPLIT;
1157        }
1158       
1159        globalPackages = getPackages();
1160        globalInstalledMods = getInstallString();
1161        for (int i = 0; i < globalPackages.size(); i++) {
1162                Mods_CheckboxList->Append(globalPackages[i].name.c_str());
1163                if( binary_search(globalInstalledMods.begin(), globalInstalledMods.end(), globalPackages[i].modStringName ) ) Mods_CheckboxList->Check(i);
1164        }
1165
1166        TheStatusBar = &StatusArea;
1167        TheInstallButton = InstallButton;
1168        TheProgressBar = ProgressBar;
1169        OptionsPanel->Hide();
1170       
1171//#ifndef WIN32
1172//      itemMenu37->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
1173       
1174//#endif
1175       
1176        if(splitInstances == SPLIT) SeperatedRadio->SetValue(true);
1177        else CompleteRadio->SetValue(true);
1178        if(strImportOption == "-import:nosep") NoSepRadio->SetValue(true);
1179        else SepRadio->SetValue(true);
1180
1181
1182#ifdef WIN32
1183        RedirectIOToConsole(); 
1184        HWND hWnd = GetConsoleWindow(); 
1185        ShowWindow( hWnd, SW_HIDE ); 
1186#endif
1187
1188        //MainWindow::SetSize(MainWindow::GetRect().GetWidth(), MainWindow::GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight() );
1189}
1190
1191
1192/*
1193* wxEVT_COMMAND_CHECKBOX_CLICKED event handler for SelectAll_Checkbox
1194*/
1195
1196void MainWindow::OnSelectAllCheckboxClick( wxCommandEvent& event )
1197{
1198        switch(SelectAll->Get3StateValue()) {
1199        case wxCHK_UNCHECKED:
1200                for(int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, false);
1201                //SelectAll->Set3StateValue(wxCHK_CHECKED);
1202                break;
1203        case wxCHK_CHECKED:
1204                for(int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, true);
1205                //SelectAll->Set3StateValue(wxCHK_UNCHECKED);
1206                break;
1207        case wxCHK_UNDETERMINED:
1208                for(int i = 0; i < globalPackages.size(); i++) Mods_CheckboxList->Check(i, false);
1209                //SelectAll->Set3StateValue(wxCHK_CHECKED);
1210                break;
1211
1212        }
1213
1214}
1215
1216
1217/*
1218* wxEVT_CREATE event handler for Mods_CheckboxList
1219*/
1220
1221void MainWindow::ModList_OnCreate( wxWindowCreateEvent& event )
1222{
1223
1224
1225}
1226
1227
1228/*
1229* Should we show tooltips?
1230*/
1231
1232bool MainWindow::ShowToolTips()
1233{
1234        return true;
1235}
1236
1237/*
1238* Get bitmap resources
1239*/
1240
1241wxBitmap MainWindow::GetBitmapResource( const wxString& name )
1242{
1243        // Bitmap retrieval
1244        ////@begin MainWindow bitmap retrieval
1245    wxUnusedVar(name);
1246    if (name == _T("undo.xpm"))
1247    {
1248        wxBitmap bitmap( undo_xpm);
1249        return bitmap;
1250    }
1251    else if (name == _T("fileopen.xpm"))
1252    {
1253        wxBitmap bitmap( fileopen_xpm);
1254        return bitmap;
1255    }
1256    else if (name == _T("filesaveas.xpm"))
1257    {
1258        wxBitmap bitmap( filesaveas_xpm);
1259        return bitmap;
1260    }
1261    else if (name == _T("quit.xpm"))
1262    {
1263        wxBitmap bitmap( quit_xpm);
1264        return bitmap;
1265    }
1266    return wxNullBitmap;
1267        ////@end MainWindow bitmap retrieval
1268}
1269
1270/*
1271* Get icon resources
1272*/
1273
1274wxIcon MainWindow::GetIconResource( const wxString& name )
1275{
1276
1277        // Icon retrieval
1278        ////@begin MainWindow icon retrieval
1279    wxUnusedVar(name);
1280    if (name == _T("aelogosmall.png"))
1281    {
1282        wxIcon icon(aelogosmall_xpm);
1283        return icon;
1284    }
1285    return wxNullIcon;
1286        ////@end MainWindow icon retrieval
1287}
1288
1289
1290/*
1291* wxEVT_COMMAND_LISTBOX_SELECTED event handler for Mods_CheckboxList1
1292*/
1293
1294void MainWindow::OnModsCheckboxList1Selected( wxCommandEvent& event )
1295{
1296        //event.GetSelection
1297        titleText->SetValue(globalPackages[event.GetSelection()].name.c_str());
1298        creatorText->SetValue(globalPackages[event.GetSelection()].creator.c_str());
1299        descriptionText->SetValue(globalPackages[event.GetSelection()].readme.c_str());
1300
1301        //creatorText->Refresh();
1302}
1303
1304
1305/*
1306* wxEVT_COMMAND_CHECKLISTBOX_TOGGLED event handler for Mods_CheckboxList1
1307*/
1308
1309void MainWindow::OnModsCheckboxList1Toggled( wxCommandEvent& event )
1310{
1311        SelectAll->Set3StateValue(wxCHK_UNDETERMINED);
1312        if(event.GetInt()) {
1313                /*
1314                switch(SelectAll->Get3StateValue()) {
1315                case wxCHK_UNCHECKED:
1316                break;
1317                case wxCHK_CHECKED:
1318                break;
1319                case wxCHK_UNDETERMINED :
1320                break;
1321                }
1322                */
1323        }
1324}
1325
1326
1327/*
1328* wxEVT_COMMAND_MENU_SELECTED event handler for wxID_OPTIONS
1329*/
1330
1331void MainWindow::OnOptionsClick( wxCommandEvent& event )
1332{
1333        if (!event.GetInt() ) {
1334                OptionsPanel->Hide(); 
1335               
1336                this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()-OptionsPanel->GetRect().GetHeight());}
1337        else {
1338//              Uncomment this when we release, it gets annoying if you are testing globalization a lot ;)
1339                wxMessageDialog* YesNoDialog = new wxMessageDialog(this,                        "WARNING: These options are for advanced users only, use with caution.",
1340                                                                                                                   "AE Installer Alert",  wxOK | wxICON_EXCLAMATION     , wxDefaultPosition);
1341                YesNoDialog->ShowModal();
1342                OptionsPanel->Show();
1343                this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()+OptionsPanel->GetRect().GetHeight()+1);
1344                this->SetSize(this->GetRect().GetWidth(), this->GetRect().GetHeight()-1);
1345        }
1346}
1347
1348
1349/*
1350* wxEVT_COMMAND_MENU_SELECTED event handler for wxID_EXIT
1351*/
1352
1353void MainWindow::OnExitClick( wxCommandEvent& event )
1354{
1355        exit(0);
1356}
1357
1358
1359/*
1360* wxEVT_COMMAND_BUTTON_CLICKED event handler for Install_Button
1361*/
1362
1363
1364struct recompile
1365{
1366        recompile(vector<string> localPackages) : thePackages(localPackages) { }
1367        void operator()()
1368        {
1369                TheInstallButton->Disable();
1370                recompileAll(thePackages);
1371                TheInstallButton->Enable();
1372        }
1373
1374        vector<string> thePackages;
1375};
1376
1377void MainWindow::OnInstallButtonClick( wxCommandEvent& event )
1378{
1379
1380        vector<string> localPackages;
1381        localPackages.push_back("Globalize");
1382        for(int i = 0; i < globalPackages.size(); i++) if(Mods_CheckboxList->IsChecked(i)) localPackages.push_back( globalPackages[i].modStringName );
1383        if ( !localPackages.empty() )   {
1384       
1385                //MainWindow::MainWindow().Hide();     
1386                //      boost::thread thrd2(recompileAll(localPackages) );
1387                //MainWindow::MainWindow().Show();
1388                this->InstallButton->Disable();
1389                this->ReglobalizeButton->Disable();
1390#ifdef WIN32
1391                recompile packages(localPackages);
1392                boost::thread thrd(packages);
1393#else
1394                recompileAll(localPackages);
1395#endif
1396
1397                this->InstallButton->Enable();
1398                this->ReglobalizeButton->Enable();
1399        }
1400
1401
1402}
1403
1404/*void setStatusArea( string s ) {
1405//TheStatusBar = MainWindow::StatusArea;
1406(**TheStatusBar).SetStatusText(_(s.c_str()), 0);
1407
1408//MainWindow::MainWindow().SetSize(MainWindow::MainWindow().GetRect().GetWidth(), MainWindow::MainWindow().GetRect().GetHeight()+1);
1409
1410//MainWindow::StatusBar->SetLabel("Importing Files...");
1411//StatusBar->SetLabel(s);
1412//->SetLabel(s);
1413
1414}*/
1415
1416void setProgressBar( int i ) {
1417        //TheProgressBar->SetValue(
1418#ifdef WIN32
1419       
1420
1421
1422if (SUCCEEDED(pTaskbarList->QueryInterface(IID_ITaskbarList3, (void **)&pTaskbarList3)))
1423{
1424       
1425        pTaskbarList3->SetProgressValue(Handle,i, 1000);
1426        if ( i == 0 ) {
1427
1428        pTaskbarList3->SetProgressState(Handle,TBPF_NOPROGRESS);
1429        }
1430}
1431
1432
1433#endif
1434        TheProgressBar->SetValue(i);
1435
1436}
1437
1438
1439/*
1440* wxEVT_UPDATE_UI event handler for ID_STATUSBAR
1441*/
1442
1443void MainWindow::OnStatusbarUpdate( wxUpdateUIEvent& event )
1444{
1445        ////@begin wxEVT_UPDATE_UI event handler for ID_STATUSBAR in MainWindow.
1446    // Before editing this code, remove the block markers.
1447    event.Skip();
1448        ////@end wxEVT_UPDATE_UI event handler for ID_STATUSBAR in MainWindow.
1449}
1450
1451
1452/*
1453* wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT
1454*/
1455
1456void MainWindow::OnAboutClick( wxCommandEvent& event )
1457{
1458        ////@begin wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow.
1459    // Before editing this code, remove the block markers.
1460    About* window = new About(this);
1461    int returnValue = window->ShowModal();
1462    window->Destroy();
1463        ////@end wxEVT_COMMAND_MENU_SELECTED event handler for wxID_ABOUT in MainWindow.
1464}
1465
1466
1467/*
1468* wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for NoSep_RadioButton
1469*/
1470
1471void MainWindow::OnNoSepRadioButtonSelected( wxCommandEvent& event )
1472{
1473        static_cast<string>("-import:nosep");
1474}
1475
1476
1477/*
1478* wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Sep_RadioButton
1479*/
1480
1481void MainWindow::OnSepRadioButtonSelected( wxCommandEvent& event )
1482{
1483        static_cast<string>("-import:sep");
1484}
1485
1486
1487/*
1488* wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton
1489*/
1490
1491/*
1492* wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Complete_RadioButton
1493*/
1494
1495void MainWindow::OnCompleteRadioButtonSelected( wxCommandEvent& event )
1496{
1497        splitInstances = NOT_SPLIT;
1498
1499}
1500
1501
1502/*
1503* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BITMAPBUTTON
1504*/
1505
1506void MainWindow::OnRefreshButtonClick( wxCommandEvent& event )
1507{
1508        refreshMods(globalInstalledMods);
1509}
1510
1511
1512/*
1513* wxEVT_COMMAND_MENU_SELECTED event handler for wxID_LOAD
1514*/
1515
1516
1517
1518
1519void MainWindow::refreshMods (vector<string> s) {
1520
1521        Mods_CheckboxList->Clear();
1522        //globalInstalledMods = getPackages();
1523        for (int i = 0; i < globalPackages.size(); i++) {
1524                Mods_CheckboxList->Append(globalPackages[i].name.c_str());
1525                if( binary_search(s.begin(), s.end(), globalPackages[i].modStringName ) ) Mods_CheckboxList->Check(i);
1526                //else Mods_CheckboxList->Check(i,0);
1527
1528        }
1529}
1530
1531void MainWindow::OnLoadClick( wxCommandEvent& event )
1532{
1533        if (busy == 1) return;
1534        static const wxChar *FILETYPES = _T(
1535                "Mod Loadouts (*.cfg)|*.cfg|"
1536                "All files (*.*)|*.*"
1537                );
1538
1539        wxFileDialog* openFileDialog =
1540                new wxFileDialog( this, _("Open Mod Loadout"), "", "", FILETYPES,
1541                wxOPEN, wxDefaultPosition);
1542
1543        if ( openFileDialog->ShowModal() == wxID_OK )
1544        {
1545                refreshMods(getInstallString( string(openFileDialog->GetPath()) ));
1546        }
1547
1548
1549}
1550
1551
1552/*
1553* wxEVT_COMMAND_MENU_SELECTED event handler for wxID_SAVE
1554*/
1555
1556void MainWindow::OnSaveClick( wxCommandEvent& event )
1557{
1558        if (busy == 1) return;
1559        static const wxChar *FILETYPES = _T(
1560                "Mod Loadouts (*.cfg)|*.cfg|"
1561                "All files (*.*)|*.*"
1562                );
1563
1564        wxFileDialog* openFileDialog =
1565                new wxFileDialog( this, _("Open file"), "", "", FILETYPES,
1566                wxSAVE, wxDefaultPosition);
1567
1568        if ( openFileDialog->ShowModal() == wxID_OK )
1569        {
1570
1571
1572                //Mods_CheckboxList->
1573
1574
1575
1576                //
1577
1578                if ( exists( openFileDialog->GetPath().c_str() ) )
1579                {
1580                        remove( openFileDialog->GetPath().c_str() );
1581                }
1582
1583                ofstream file(openFileDialog->GetPath().c_str());
1584
1585                vector<string>list;
1586                for(int i = 0; i < globalPackages.size(); i++) if(Mods_CheckboxList->IsChecked(i)) list.push_back( globalPackages[i].modStringName );
1587                vector<string>::iterator begin_iter = list.begin(); 
1588                vector<string>::iterator end_iter = list.end();
1589
1590                sort( list.begin(), list.end() );
1591
1592                for( ; begin_iter != end_iter; ++begin_iter) {
1593                        file << *begin_iter << " ";
1594                }
1595
1596                file.close();
1597                file.clear();
1598
1599                //SetCurrentFilename(openFileDialog->GetFilename());
1600                //theText->LoadFile(openFileDialog->GetFilename());
1601                //SetStatusText(GetCurrentFilename(), 0);
1602                //SetStatusText(openFileDialog->GetDirectory(),1);
1603        }
1604}
1605
1606
1607
1608/*
1609* wxEVT_COMMAND_BUTTON_CLICKED event handler for ReGlobalize_Button
1610*/
1611
1612void MainWindow::OnReGlobalizeButtonClick( wxCommandEvent& event )
1613{
1614        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);
1615
1616        if (YesNoDialog->ShowModal() == wxID_NO) { //if the user said no...
1617
1618        }
1619        else {
1620       
1621                this->InstallButton->Disable();
1622                this->ReglobalizeButton->Disable();
1623
1624#ifdef WIN32
1625
1626                boost::thread thrd2(globalizeData);
1627                //globalizeData();
1628                //boost::thread::create_thread(&globalizeData);
1629                //       boost::thread_group Tg;
1630                // Tg.create_thread( &globalizeData(), this );
1631#else
1632                globalizeData();
1633#endif
1634               
1635                this->InstallButton->Enable();
1636                this->ReglobalizeButton->Enable();
1637        }
1638
1639}
1640/*
1641* wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton
1642*/
1643
1644/*void MainWindow::OnSeparatedRadioButtonSelected( wxCommandEvent& event )
1645{
1646////@begin wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton in MainWindow.
1647// Before editing this code, remove the block markers.
1648event.Skip();
1649////@end wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Separated_RadioButton in MainWindow.
1650}*/
1651
1652
1653/*
1654 * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for Seperated_RadioButton
1655 */
1656
1657void MainWindow::OnSeperatedRadioButtonSelected( wxCommandEvent& event )
1658{
1659splitInstances = SPLIT;
1660}
1661
Note: See TracBrowser for help on using the repository browser.