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

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