// ------------------------------------------------ BORDER OF FUNCTION ---------------------------------------------------------- // private void button_Uninstall_Click(object sender, EventArgs e) { if (listBox1.SelectedIndex != -1) { if (FuncMisc.dialogResult(textDeleteMod)) { if (File.Exists(FormMain.pathModsFolder + listBox1.SelectedItem.ToString().Replace(".rar", ".txt"))) { foreach (string line in File.ReadLines(FormMain.pathModsFolder + listBox1.SelectedItem.ToString().Replace(".rar", ".txt"))) { FuncFiles.deleteAny(FormMain.pathGameFolder + line); } if (listBox1.SelectedItem.ToString().ToUpper().Contains("OSA") && File.Exists(FormMain.pathFNISRAR)) { FuncMisc.unpackRAR(FormMain.pathFNISRAR); } } else { MessageBox.Show(textNoUninstalFile); } } } else { MessageBox.Show(textNoFileSelect); } }
// ------------------------------------------------ BORDER OF FUNCTION ---------------------------------------------------------- // private void button_Uninstall_Click(object sender, EventArgs e) { if (FuncMisc.dialogResult(textRemoveENB)) { FuncClear.removeENB(); FuncParser.iniWrite(FormMain.pathLauncherINI, "ENB", "LastPreset", ""); refreshAllValue(); } }
// ------------------------------------------------ BORDER OF FUNCTION ---------------------------------------------------------- // private void button_ResetSettings_Click(object sender, EventArgs e) { label1.Focus(); if (FuncMisc.dialogResult(textSettingsReset)) { resetSettings(); button_Options_Click(this, new EventArgs()); } }
// ------------------------------------------------ BORDER OF FUNCTION ---------------------------------------------------------- // private void button_ClearDirectory_Click(object sender, EventArgs e) { label1.Focus(); if (FuncMisc.dialogResult(textClearDirectory)) { FuncFiles.deleteAny(pathMyDoc + "SKSE"); FuncFiles.deleteAllInFolder(pathMyDoc + "Logs", "*"); FuncFiles.deleteAllInFolder(pathMyDoc + "Saves", "*.bak"); FuncFiles.deleteAny(Path.GetFullPath(pathGameFolder + @"..\Skyrim Mods")); FuncClear.clearGameFolder(); } }
// ------------------------------------------------ BORDER OF FUNCTION ---------------------------------------------------------- // private void button_FNIS_Click(object sender, EventArgs e) { label1.Focus(); if (File.Exists(pathFNIS)) { if (File.Exists(pathFNISRAR)) { if (FuncMisc.dialogResult(textUnPackFNIS)) { FuncMisc.unpackRAR(pathFNISRAR); } } pressedButtonEvent(button_FNIS, BMbuttonHalfPressed, button_Half_MouseEnter, button_Half_MouseLeave); FuncMisc.runProcess(pathFNIS, null, closeFNIS, this, false, false); } else { MessageBox.Show(pathFNIS + textNotFound); } }
// ------------------------------------------------ BORDER OF FUNCTION ---------------------------------------------------------- // private void button_Uninstall_Click(object sender, EventArgs e) { if (listBox1.SelectedIndex != -1) { if (FuncMisc.dialogResult(textDeleteMod)) { string file = FormMain.pathModsFolder + listBox1.SelectedItem.ToString().Replace(".rar", ".txt"); if (File.Exists(file)) { foreach (string line in File.ReadLines(file)) { if (line.StartsWith("[")) { break; } else if (line.Length > 0) { FuncFiles.deleteAny(FormMain.pathGameFolder + line); } } if (FuncParser.keyExists(file, "UNINSTALL", "UNPACK")) { FuncMisc.unpackRAR(FormMain.pathGameFolder + FuncParser.stringRead(file, "UNINSTALL", "UNPACK")); } } else { MessageBox.Show(textNoUninstalFile); } } } else { MessageBox.Show(textNoFileSelect); } }
// ------------------------------------------------ BORDER OF FUNCTION ---------------------------------------------------------- // private void button_CheckUpdate_Click(object sender, EventArgs e) { if (stopDownload) { client.CancelAsync(); stopDownload = false; enableDisableButtons(); } else { stopDownload = true; enableDisableButtons(); if (updatesFound) { string line1 = FuncParser.stringRead(pathUpdateFolder + nameUpdateInfo, "Update_" + numberSelectFile, "update_file_warning"); bool confirm = false; bool request = false; if (line1 != null) { if (FuncMisc.dialogResult(textPleaseRead + line1 + Environment.NewLine + Environment.NewLine + textContinue)) { confirm = true; } line1 = null; } else { confirm = true; } if (confirm) { string line2 = FuncParser.stringRead(pathUpdateFolder + nameUpdateInfo, "Update_" + numberSelectFile, "update_request_update"); if (line2 != null) { if (FuncParser.doubleRead(pathUpdateFolder + nameUpdateInfo, "Update_" + line2, "update_file_version") <= FuncParser.doubleRead(FormMain.pathLauncherINI, "Updates", "Update_" + line2 + "_Version")) { request = true; } else { MessageBox.Show(textRequiredVersion + FuncParser.stringRead(pathUpdateFolder + nameUpdateInfo, "Update_" + line2, "update_file")); } line2 = null; } else { request = true; } } if (confirm && request) { if (checkUpdateFile(false)) { unpackUpdates(true); } else { FuncFiles.deleteAny(pathUpdateFolder + "file" + numberSelectFile + ".rar"); downloadFileName = "file" + numberSelectFile + ".rar"; downloadFileType = "UpdateG"; client_DownloadProgressStart(); } } else { stopDownload = false; enableDisableButtons(); } } else { FuncFiles.deleteAny(pathUpdateFolder + nameUpdateInfo); downloadFileName = nameUpdateInfo; downloadFileType = "CheckU"; realIndexI.Clear(); realIndex.Clear(); installPreLoad.Clear(); client_DownloadProgressStart(); } } }