//////////////////////////////////////////////////////ГРАНИЦА ФУНКЦИИ////////////////////////////////////////////////////////////// private void button_Skyrim_Click(object sender, EventArgs e) { label1.Focus(); if (File.Exists(pathGameFolder + "SKSE.exe")) { pressButtonEvent(button_Skyrim, BMbuttonlogoPressed, buttonSkyrim_MouseEnter, buttonSkyrim_MouseLeave); if (argsStartsWith != null && File.Exists(argsStartsWith)) { FuncMisc.runProcess(argsStartsWith, null, null, null, false); } if (argsWaitBefore != null) { int WaitTime = FuncParser.stringToInt(argsWaitBefore); if (WaitTime > 0) { FuncMisc.toggleButtons(this, false); Thread.Sleep(WaitTime * 1000); FuncMisc.toggleButtons(this, true); button_Skyrim.Enabled = false; } } FuncMisc.runProcess(pathGameFolder + "SKSE.exe", "-forcesteamloader", SKSEExited, this, false); } else { MessageBox.Show("SKSE.exe" + notFound); } }
// ------------------------------------------------ BORDER OF FUNCTION ---------------------------------------------------------- // private void button_Help_Click(object sender, EventArgs e) { label1.Focus(); if (File.Exists(pathHelp)) { FuncMisc.runProcess(pathHelp, null, null, this, true, false); } else { MessageBox.Show(pathHelp + textNotFound); } }
//////////////////////////////////////////////////////ГРАНИЦА ФУНКЦИИ////////////////////////////////////////////////////////////// private void button_DSRStart_Click(object sender, EventArgs e) { label1.Focus(); if (File.Exists(pathDSR)) { pressButtonEvent(button_DSRStart, BMbuttonHalfPressed, buttonH_MouseEnter, buttonH_MouseLeave); FuncMisc.runProcess(pathDSR, null, DSRExited, this, false); } else { MessageBox.Show(pathDSR + notFound); } }
//////////////////////////////////////////////////////ГРАНИЦА ФУНКЦИИ////////////////////////////////////////////////////////////// private void button_WryeBash_Click(object sender, EventArgs e) { label1.Focus(); if (File.Exists(pathWB)) { pressButtonEvent(button_WryeBash, BMbuttonFullPressed, button_MouseEnter, button_MouseLeave); FuncMisc.runProcess(pathWB, null, WryeBashExited, this, false); } else { MessageBox.Show(pathWB + notFound); } }
// ------------------------------------------------ BORDER OF FUNCTION ---------------------------------------------------------- // private void button_DSR_Click(object sender, EventArgs e) { label1.Focus(); if (File.Exists(pathDSR)) { pressedButtonEvent(button_DSR, BMbuttonHalfPressed, button_Half_MouseEnter, button_Half_MouseLeave); FuncMisc.runProcess(pathDSR, null, closeDSR, this, true, false); } else { MessageBox.Show(pathDSR + textNotFound); } }
// ------------------------------------------------ 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); } }
//////////////////////////////////////////////////////ГРАНИЦА ФУНКЦИИ////////////////////////////////////////////////////////////// private void button_Skyrim_Click(object sender, EventArgs e) { label1.Focus(); if (File.Exists(pathGameFolder + "SKSE.exe")) { pressButtonEvent(button_Skyrim, BMbuttonlogoPressed, buttonSkyrim_MouseEnter, buttonSkyrim_MouseLeave); if (argsStartsWith != null && File.Exists(argsStartsWith)) { Process.Start(argsStartsWith); } if (argsWaitBefore > 0) { Thread.Sleep(argsWaitBefore * 1000); } FuncMisc.runProcess(pathGameFolder + "SKSE.exe", "-forcesteamloader", SKSEExited, this, false); } else { MessageBox.Show("SKSE.exe" + notFound); } }
//////////////////////////////////////////////////////ГРАНИЦА ФУНКЦИИ////////////////////////////////////////////////////////////// private void button_FNIS_Click(object sender, EventArgs e) { label1.Focus(); if (File.Exists(pathFNIS)) { if (File.Exists(pathFNISRAR)) { DialogResult dialogResult = MessageBox.Show(unPackFNIS, confirmTitle, MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { FuncMisc.unpackRAR(pathFNISRAR); } } pressButtonEvent(button_FNISStart, BMbuttonHalfPressed, buttonH_MouseEnter, buttonH_MouseLeave); FuncMisc.runProcess(pathFNIS, null, FNISExited, this, false); } else { MessageBox.Show(pathFNIS + notFound); } }
// ------------------------------------------------ BORDER OF FUNCTION ---------------------------------------------------------- // private void client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e) { if (stopDownload) { if (File.Exists(pathUpdateFolder + nameUpdateInfo)) { if (downloadFileType == "CheckU") { int CountComboBox = FuncParser.intRead(pathUpdateFolder + nameUpdateInfo, "General", "numbers_files_update"); if (CountComboBox > 0) { for (int i = 1; i <= CountComboBox; i++) { comboBox_Updates.SelectedIndexChanged -= comboBox_Updates_SelectedIndexChanged; if (checkUpdateVersion(i)) { realIndexI.Add(i); installPreLoad.Add(textInstalled + " / " + FuncParser.stringRead(pathUpdateFolder + nameUpdateInfo, "Update_" + i, "update_file")); } else { realIndex.Add(i); comboBox_Updates.Items.Add(textAvailable + " / " + FuncParser.stringRead(pathUpdateFolder + nameUpdateInfo, "Update_" + i, "update_file")); } comboBox_Updates.SelectedIndexChanged += comboBox_Updates_SelectedIndexChanged; } for (int i = 0; i < realIndexI.Count; i++) { realIndex.Add(realIndexI[i]); comboBox_Updates.Items.Add(installPreLoad[i]); } if (comboBox_Updates.Items.Count > 0) { comboBox_Updates.SelectedIndex = 0; } updatesFound = true; label4.Text = CountComboBox.ToString(); } else { updatesFound = false; label4.Text = textNoUpdate; } string line = FuncParser.stringRead(pathUpdateFolder + nameUpdateInfo, "General", "version_control_panel"); if (line != null) { var result = new Version(FormMain.panelFileVersion).CompareTo(new Version(line)); updatesCPFound = result < 0; } } if (downloadFileType == "UpdateG") { if (checkUpdateFile(true)) { unpackUpdates(false); } } if (downloadFileType == "UpdateCP") { string version1 = FileVersionInfo.GetVersionInfo(pathUpdateFolder + nameControlPanel).ProductVersion; if (version1 == FuncParser.stringRead(pathUpdateFolder + nameUpdateInfo, "General", "version_control_panel")) { FuncMisc.writeToFile(FormMain.pathLauncherFolder + "Update.bat", new List <string>() { "@Echo off", "mode con:cols=50 lines=10", "color 0E", "cd %~dp0", "SET CP_S=" + FormMain.pathLauncherExecuting, "SET CP_U=" + pathUpdateFolder + nameControlPanel, "Echo Please Wait 5 second before start update.", "TIMEOUT /T 2 /NOBREAK >nul 2>nul", "IF EXIST \"%CP_U%\" (", "Echo -Update file found.", "TIMEOUT /T 1 /NOBREAK >nul 2>nul", "Echo -Delete old file control panel.", "del \"%CP_S%\" /Q >nul 2>nul", "TIMEOUT /T 1 /NOBREAK >nul 2>nul", "Echo -Move new file control panel.", "move /Y \"%CP_U%\" \"%CP_S%\" >nul 2>nul", "TIMEOUT /T 1 /NOBREAK >nul 2>nul", "Echo -Expectation launching new control panel.", "start \"Run new file\" \"%CP_S%\" >nul 2>nul", ") else (", "Echo -Update file not found...", "TIMEOUT /T 5 /NOBREAK >nul 2>nul", ")", "Echo -Closing.", "TIMEOUT /T 2 /NOBREAK >nul 2>nul", "del \"" + FormMain.pathLauncherFolder + "Update.bat\" /Q >nul 2>nul" }); FuncMisc.runProcess(FormMain.pathLauncherFolder + "Update.bat", null, null, this, true, false); Application.Exit(); } else { MessageBox.Show(textNoSyncWithUI); FuncFiles.deleteAny(pathUpdateFolder + nameControlPanel); } } } else { updatesFound = false; updatesCPFound = false; } } stopDownload = false; progressBar1.Value = 0; enableDisableButtons(); }