Пример #1
0
        //////////////////////////////////////////////////////ГРАНИЦА ФУНКЦИИ//////////////////////////////////////////////////////////////
        private void button_ClearDirectory_Click(object sender, EventArgs e)
        {
            label1.Focus();
            DialogResult dialogResult = MessageBox.Show(clearDirectory, confirmTitle, MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                FuncFiles.deleteAny(pathMyDoc + "Logs");
                FuncFiles.deleteAny(pathMyDoc + "SKSE");
                if (FuncParser.stringRead(pathSkyrimINI, "Papyrus", "bEnableLogging") == "1")
                {
                    FuncFiles.creatDirectory(pathMyDoc + "Logs");
                }
                if (Directory.Exists(pathMyDoc + "Saves"))
                {
                    foreach (string line in Directory.GetFiles(pathMyDoc + "Saves", "*.bak"))
                    {
                        FuncFiles.deleteAny(line);
                    }
                }
                FuncFiles.deleteAny(pathGameFolder + @"..\Skyrim Mods");
                FuncClear.clearGameFolder();
                FuncClear.emptyFolder(pathGameFolder);
            }
        }
Пример #2
0
 private void refreshValueLabelPapyrus()
 {
     papyrus = FuncMisc.refreshButton(button_Papyrus, FormMain.pathSkyrimINI, "Papyrus", "bEnableLogging", null, false);
     if (papyrus)
     {
         FuncFiles.creatDirectory(FormMain.pathMyDoc + "Logs");
     }
 }
Пример #3
0
 // ------------------------------------------------ BORDER OF FUNCTION ---------------------------------------------------------- //
 private void client_DownloadProgressStart()
 {
     try
     {
         FuncFiles.creatDirectory(pathUpdateFolder);
         client.DownloadFileAsync(new Uri(nameHostName + downloadFileName), pathUpdateFolder + downloadFileName);
     }
     catch
     {
         stopDownload = false;
         enableDisableButtons();
         MessageBox.Show(textWrongPing + nameHostName + downloadFileName);
     }
 }
Пример #4
0
 public void resetSettings()
 {
     if (File.Exists(pathLauncherFolder + "Skyrim.ini") && File.Exists(pathLauncherFolder + "SkyrimPrefs.ini") && File.Exists(pathLauncherFolder + @"MasterList\Plugins.txt"))
     {
         try
         {
             RegistryKey key;
             key = Registry.LocalMachine.CreateSubKey(registryPath);
             key.SetValue(registryKey, pathGameFolder);
             key.Close();
         }
         catch
         {
             MessageBox.Show(failWriteToRegistry + registryPath + " " + registryKey + "=" + pathGameFolder);
         }
         FuncFiles.deleteAny(pathSkyrimINI);
         FuncFiles.deleteAny(pathSkyrimPrefsINI);
         FuncFiles.deleteAny(pathMyDoc + "Logs");
         FuncFiles.deleteAny(pathMyDoc + "SKSE");
         FuncFiles.deleteAny(pathMyDoc + "SkyProc");
         FuncFiles.deleteAny(pathMyDoc + "BashSettings.dat");
         FuncFiles.deleteAny(pathMyDoc + "BashSettings.dat.bak");
         FuncFiles.deleteAny(pathMyDoc + "RendererInfo.txt");
         FuncFiles.deleteAny(pathMyDoc + @"Saves\Bash");
         FuncFiles.creatDirectory(pathMyDoc);
         FuncFiles.copyAny(pathLauncherFolder + "Skyrim.ini", pathSkyrimINI);
         FuncFiles.copyAny(pathLauncherFolder + "SkyrimPrefs.ini", pathSkyrimPrefsINI);
         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);
         FuncFiles.copyAny(pathLauncherFolder + @"MasterList\Plugins.txt", pathAppData + @"Plugins.txt");
         FuncFiles.copyAny(pathLauncherFolder + @"MasterList\Plugins.txt", pathAppData + @"LoadOrder.txt");
         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();
         MessageBox.Show(typeSettings[settingsPreset] + setSettings);
     }
     else
     {
         MessageBox.Show(notFoundTemplates);
     }
 }
Пример #5
0
 public void resetSettings()
 {
     try
     {
         RegistryKey key;
         key = Registry.LocalMachine.CreateSubKey(registryPath);
         key.SetValue(registryKey, pathGameFolder);
         key.Close();
     }
     catch
     {
         MessageBox.Show(textRegistryFail + 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 + "BashLoadOrders.dat");
     FuncFiles.deleteAny(pathMyDoc + "BashLoadOrders.dat.bak");
     FuncFiles.deleteAny(pathMyDoc + "ModChecker.html");
     FuncFiles.deleteAny(pathMyDoc + "RendererInfo.txt");
     FuncFiles.deleteAny(pathMyDoc + @"Saves\Bash");
     FuncFiles.deleteAny(pathSkyrimINI);
     FuncFiles.deleteAny(pathMyDoc + "Skyrim.ini.BethINIbackup");
     FuncFiles.deleteAny(pathSkyrimPrefsINI);
     FuncFiles.deleteAny(pathMyDoc + "SkyrimPrefs.ini.BethINIbackup");
     FuncFiles.creatDirectory(pathMyDoc);
     if (File.Exists(pathLauncherFolder + "Skyrim.ini"))
     {
         FuncFiles.copyAny(pathLauncherFolder + "Skyrim.ini", pathSkyrimINI);
     }
     else
     {
         MessageBox.Show(textUseStandart + pathLauncherFolder + "Skyrim.ini");
         FuncMisc.writeToFile(pathSkyrimINI, FuncSettings.skyrimINI());
     }
     if (File.Exists(pathLauncherFolder + "SkyrimPrefs.ini"))
     {
         FuncFiles.copyAny(pathLauncherFolder + "SkyrimPrefs.ini", pathSkyrimPrefsINI);
     }
     else
     {
         MessageBox.Show(textUseStandart + pathLauncherFolder + "SkyrimPrefs.ini");
         FuncMisc.writeToFile(pathSkyrimPrefsINI, FuncSettings.skyrimPrefsINI());
     }
     if (File.Exists(pathProgramFilesFolder + "BashSettings.dat"))
     {
         FuncFiles.copyAny(pathProgramFilesFolder + "BashSettings.dat", pathMyDoc + "BashSettings.dat");
     }
     FuncFiles.deleteAny(pathAppData + "DLCList.txt");
     FuncFiles.deleteAny(pathAppData + "Plugins.txt");
     FuncFiles.deleteAny(pathAppData + "LoadOrder.txt");
     FuncFiles.deleteAny(pathAppData + "Plugins.tes5viewsettings");
     FuncFiles.creatDirectory(pathAppData);
     if (File.Exists(pathLauncherFolder + "Plugins.txt"))
     {
         FuncFiles.copyAny(pathLauncherFolder + "Plugins.txt", pathAppData + "Plugins.txt");
         FuncFiles.copyAny(pathLauncherFolder + "Plugins.txt", pathAppData + "LoadOrder.txt");
     }
     else
     {
         MessageBox.Show(textUseStandart + pathLauncherFolder + "Plugins.txt");
         FuncMisc.writeToFile(pathAppData + "Plugins.txt", FuncSettings.pluginsTXT());
         FuncMisc.writeToFile(pathAppData + "LoadOrder.txt", FuncSettings.pluginsTXT());
     }
     if (File.Exists(pathProgramFilesFolder + "Plugins.tes5viewsettings"))
     {
         FuncFiles.copyAny(pathProgramFilesFolder + "Plugins.tes5viewsettings", pathAppData + "Plugins.tes5viewsettings");
     }
     if (File.Exists(pathSkyrimINI) && File.Exists(pathSkyrimPrefsINI))
     {
         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] + textSetSettings);
     }
     else
     {
         MessageBox.Show(textSetSettingsFail);
     }
 }