--- AE/Installer/trunk/source/main_window.cpp 2009/07/06 22:56:35 399 +++ AE/Installer/trunk/source/main_window.cpp 2009/07/08 17:20:07 410 @@ -121,7 +121,7 @@ int globalizeData(void) path TRAM = Animations / "level0_TRAM"; vector GDFPaths; - GDFPaths.push_back(Characters); + //GDFPaths.push_back(Characters); GDFPaths.push_back(Particles); GDFPaths.push_back(Textures); GDFPaths.push_back(Sounds); @@ -129,17 +129,17 @@ int globalizeData(void) GDFPaths.push_back(TRAM); - path VanillaCharacters = "packages/VanillaDats/level0_Final/level0_Characters/level0_Characters.oni"; - path VanillaParticles = "packages/VanillaDats/level0_Final/level0_Particles/level0_Particles.oni"; - path VanillaTextures = "packages/VanillaDats/level0_Final/level0_Textures/level0_Textures.oni"; - path VanillaSounds = "packages/VanillaDats/level0_Final/level0_Sounds/level0_Sounds.oni"; - path VanillaAnimations = "packages/VanillaDats/level0_Final/level0_Animations/level0_Animations.oni"; - path VanillaTRAC = "packages/VanillaDats/level0_Final/level0_Animations/level0_TRAC.oni"; - path VanillaTRAM = "packages/VanillaDats/level0_Final/level0_Animations/level0_TRAM.oni"; + path VanillaCharacters = "VanillaDats/level0_Final/level0_Characters/level0_Characters.oni"; + path VanillaParticles = "VanillaDats/level0_Final/level0_Particles/level0_Particles.oni"; + path VanillaTextures = "VanillaDats/level0_Final/level0_Textures/level0_Textures.oni"; + path VanillaSounds = "VanillaDats/level0_Final/level0_Sounds/level0_Sounds.oni"; + path VanillaAnimations = "VanillaDats/level0_Final/level0_Animations/level0_Animations.oni"; + path VanillaTRAC = "VanillaDats/level0_Final/level0_Animations/level0_TRAC.oni"; + path VanillaTRAM = "VanillaDats/level0_Final/level0_Animations/level0_TRAM.oni"; vector VanillaPaths; - VanillaPaths.push_back(VanillaCharacters); + //VanillaPaths.push_back(VanillaCharacters); VanillaPaths.push_back(VanillaParticles); VanillaPaths.push_back(VanillaTextures); VanillaPaths.push_back(VanillaSounds); @@ -169,11 +169,11 @@ int globalizeData(void) create_directory( "packages" ); - if (exists("packages/VanillaDats")) remove_all("packages/VanillaDats"); - create_directory( "packages/VanillaDats" ); - create_directory( "packages/VanillaDats/level0_Final/" ); + if (exists("VanillaDats")) remove_all("VanillaDats"); + create_directory( "VanillaDats" ); + create_directory( "VanillaDats/level0_Final/" ); //blah blah finish this. - //logfile << "packages/VanillaDats/level0_Final/ created"; + //logfile << "VanillaDats/level0_Final/ created"; create_directory( Characters ); create_directory( Particles ); create_directory( Archive ); @@ -205,8 +205,8 @@ int globalizeData(void) create_directory( "../GameDataFolder/level" + levels[i] + "_Final" ); // setStatusArea(strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat"); system((strOniSplit + " -export ../GameDataFolder/level" + levels[i] + "_Final ../../GameDataFolder/level" + levels[i] + "_Final.dat").c_str()); - create_directory( "packages/VanillaDats/level" + levels[i] + "_Final" ); - create_directory( "packages/VanillaDats/level" + levels[i] + "_Final/level" + levels[i] + "_Final" ); + create_directory( "VanillaDats/level" + levels[i] + "_Final" ); + create_directory( "VanillaDats/level" + levels[i] + "_Final/level" + levels[i] + "_Final" ); directory_iterator end_iter; for ( directory_iterator dir_itr( "../GameDataFolder/level" + levels[i] + "_Final" ); dir_itr != end_iter; ++dir_itr ) @@ -229,7 +229,7 @@ int globalizeData(void) else remove(dir_itr->path()); } else if (dir_itr->path().filename().substr(0,4) == "TRAC" - || dir_itr->path().filename().substr(0,4) == "ONVL") { + ) { cout <path().filename() << "\n"; if(!exists( TRAC / dir_itr->filename())) rename(dir_itr->path(), TRAC / dir_itr->filename()); else remove(dir_itr->path()); @@ -249,6 +249,7 @@ int globalizeData(void) else if (dir_itr->path().filename().substr(0,4) == "ONCC" || dir_itr->path().filename().substr(0,4) == "TRBS" || dir_itr->path().filename().substr(0,4) == "ONCV" + || dir_itr->path().filename().substr(0,4) == "ONVL" || dir_itr->path().filename().substr(0,4) == "TRMA" || dir_itr->path().filename().substr(0,4) == "TRSC" || dir_itr->path().filename().substr(0,4) == "TRAS") { @@ -286,9 +287,10 @@ int globalizeData(void) else if (dir_itr->path().filename().substr(0,4) == "ONWC") { //fix for buggy ONWC overriding cout <path().filename() << "\n"; - if(!exists( "packages/VanillaDats/level0_Final/level0_Final/" + dir_itr->filename())) rename(dir_itr->path(), "packages/VanillaDats/level0_Final/level0_Final/" + dir_itr->filename()); + if(!exists( "VanillaDats/level0_Final/level0_Final/" + dir_itr->filename())) rename(dir_itr->path(), "VanillaDats/level0_Final/level0_Final/" + dir_itr->filename()); else remove(dir_itr->path()); } + if (exists(dir_itr->path())) { } @@ -315,15 +317,15 @@ int globalizeData(void) //printf(levels[i],"%d",levels[i]); //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"); setStatusArea("Step " + lexical_cast(parts_done + 1) + "/" + lexical_cast(total_steps) + " reimporting level" + levels[i]+"_Final.oni"); - logfile << (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level" + logfile << (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final VanillaDats/level" + levels[i] + "_Final/level" + levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize.log").c_str() << '\n'; - string sys_str = (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level" - + levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize.log"); + string sys_str = (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final VanillaDats/level" + levels[i] + "_Final/level" + + levels[i] + "_Final/level" + levels[i] + "_Final.oni"); system(sys_str.c_str() ); setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) )); parts_done++; } - create_directory( VanillaCharacters.parent_path() ); + //create_directory( VanillaCharacters.parent_path() ); create_directory( VanillaParticles.parent_path() ); create_directory( VanillaTextures.parent_path() ); create_directory( VanillaSounds.parent_path() ); @@ -336,6 +338,9 @@ int globalizeData(void) parts_done++; setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) )); } + logfile << "\nMoving level0_Characters\n"; + setStatusArea("Step " + lexical_cast(parts_done + 1) + "/" + lexical_cast(total_steps) + ": moving level0_Characters" ); + copy((path)"../GameDataFolder/level0_Characters", (path)("VanillaDats/level0_Final")); /* 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) )); system((strOniSplit + " " + strImportOption + " " + Characters.string() + " " + VanillaCharacters.string()).c_str()); @@ -357,8 +362,10 @@ int globalizeData(void) copy((path)"packages/VanillaBSL/IGMD", (path)"../GameDataFolder"); setProgressBar( 1000 ); - copy("../../persist.dat",".."); - copy("../../key_config.txt",".."); + if(!exists("../persist.dat")) + copy("../../persist.dat",".."); + if(!exists("../key_config.txt")) + copy("../../key_config.txt",".."); #ifndef WIN32 /* 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). @@ -547,7 +554,7 @@ void recompileAll(vector install setStatusArea("Importing levels..."); //setStatusArea("Recompiling Data..."); - path vanilla_dir = "./packages/VanillaDats/"; + path vanilla_dir = "./VanillaDats/"; string importCommand = ""; char statusString[128]; int numberOfDats = 0; @@ -578,13 +585,12 @@ void recompileAll(vector install } } - + try { //recursive_directory_iterator end_iter; out << numberOfDats; datString = out.str(); - try { for ( recursive_directory_iterator dir_itr( vanilla_dir ); dir_itr != end_iter; ++dir_itr ) @@ -598,7 +604,7 @@ void recompileAll(vector install if (exists("packages/" + installedMods[i] + "/oni/" + dir_itr->path().parent_path().filename() + '/' + dir_itr->path().filename() )) importCommand += " packages/" + installedMods[i] + "/oni/" + dir_itr->path().parent_path().filename() + '/' + dir_itr->path().filename(); - //else cout << " packages/VanillaDats/" + installedMods[i] + "/oni/"; + //else cout << " VanillaDats/" + installedMods[i] + "/oni/"; } importCommand += " ../GameDataFolder/" + dir_itr->path().filename() + ".dat >> Install.log"; @@ -1140,19 +1146,37 @@ void MainWindow::CreateControls() // Connect events and objects Mods_CheckboxList->Connect(Mods_CheckboxList1, wxEVT_CREATE, wxWindowCreateEventHandler(MainWindow::ModList_OnCreate), NULL, this); ////@end MainWindow content construction - +#ifdef WIN32 Handle = (HWND)GetHWND(); ::CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_ITaskbarList, (void **)&pTaskbarList); +#endif - if ( exists( "../../GameDataFolder/level0_Final.sep" ) ) { + /*if ( exists( "../../GameDataFolder/level0_Final.sep" ) ) { strImportOption = "-import:sep"; splitInstances = NOT_SPLIT; } else { strImportOption = "-import:nosep"; splitInstances = SPLIT; - } + }*/ + + +#ifndef WIN32 + strImportOption = "-import:sep"; + splitInstances = NOT_SPLIT; +#else + strImportOption = "-import:nosep"; + splitInstances = SPLIT; +#endif + +#ifndef WIN32 + strImportOption = "-import:sep"; + splitInstances = NOT_SPLIT; +#else + strImportOption = "-import:nosep"; + splitInstances = SPLIT; +#endif globalPackages = getPackages(); globalInstalledMods = getInstallString();