Ejemplo n.º 1
0
 public void resetSettings()
 {
     try
     {
         RegistryKey key;
         key = Registry.LocalMachine.CreateSubKey(registryPath);
         key.SetValue(registryKey, pathGameFolder);
         key.Close();
     }
     catch
     {
         MessageBox.Show(failWriteToRegistry + registryPath + " " + registryKey + "=" + pathGameFolder);
     }
     FuncFiles.deleteAny(pathMyDoc + "Logs");
     FuncFiles.deleteAny(pathMyDoc + "SKSE");
     FuncFiles.deleteAny(pathMyDoc + "SkyProc");
     FuncFiles.deleteAny(pathMyDoc + "BethINI Cache");
     FuncFiles.deleteAny(pathMyDoc + "BashSettings.dat");
     FuncFiles.deleteAny(pathMyDoc + "BashSettings.dat.bak");
     FuncFiles.deleteAny(pathMyDoc + "RendererInfo.txt");
     FuncFiles.deleteAny(pathMyDoc + @"Saves\Bash");
     FuncFiles.deleteAny(pathSkyrimINI);
     FuncFiles.deleteAny(pathSkyrimPrefsINI);
     FuncFiles.creatDirectory(pathMyDoc);
     if (File.Exists(pathLauncherFolder + "Skyrim.ini"))
     {
         FuncFiles.copyAny(pathLauncherFolder + "Skyrim.ini", pathSkyrimINI);
     }
     else
     {
         FuncMisc.writeToFile(pathSkyrimINI, FuncSettings.skyrimINI());
     }
     if (File.Exists(pathLauncherFolder + "SkyrimPrefs.ini"))
     {
         FuncFiles.copyAny(pathLauncherFolder + "SkyrimPrefs.ini", pathSkyrimPrefsINI);
     }
     else
     {
         FuncMisc.writeToFile(pathSkyrimPrefsINI, FuncSettings.skyrimPrefsINI());
     }
     if (File.Exists(pathLauncherFolder + @"MasterList\BashSettings.dat"))
     {
         FuncFiles.copyAny(pathLauncherFolder + @"MasterList\BashSettings.dat", pathMyDoc + "BashSettings.dat");
     }
     FuncFiles.deleteAny(pathAppData + @"Plugins.txt");
     FuncFiles.deleteAny(pathAppData + @"LoadOrder.txt");
     FuncFiles.deleteAny(pathAppData + @"Plugins.tes5viewsettings");
     FuncFiles.creatDirectory(pathAppData);
     if (File.Exists(pathLauncherFolder + @"MasterList\Plugins.txt"))
     {
         FuncFiles.copyAny(pathLauncherFolder + @"MasterList\Plugins.txt", pathAppData + @"Plugins.txt");
         FuncFiles.copyAny(pathLauncherFolder + @"MasterList\Plugins.txt", pathAppData + @"LoadOrder.txt");
     }
     else
     {
         FuncMisc.writeToFile(pathAppData + @"Plugins.txt", FuncSettings.pluginsTXT());
         FuncMisc.writeToFile(pathAppData + @"LoadOrder.txt", FuncSettings.pluginsTXT());
     }
     if (File.Exists(pathLauncherFolder + @"MasterList\Plugins.tes5viewsettings"))
     {
         FuncFiles.copyAny(pathLauncherFolder + @"MasterList\Plugins.tes5viewsettings", pathAppData + @"Plugins.tes5viewsettings");
     }
     FuncSettings.setSettingsPreset(settingsPreset);
     FuncParser.iniWrite(pathSkyrimPrefsINI, "Display", "iSize W", Screen.PrimaryScreen.Bounds.Width.ToString());
     FuncParser.iniWrite(pathSkyrimPrefsINI, "Display", "iSize H", Screen.PrimaryScreen.Bounds.Height.ToString());
     FuncSettings.physicsFPS();
     FuncSettings.restoreENBAdapter();
     FuncSettings.restoreENBBorderless();
     FuncSettings.restoreENBVSync();
     MessageBox.Show(typeSettings[settingsPreset] + setSettings);
 }