private void refreshPredictFPS() { FuncMisc.refreshComboBox(comboBoxPredictFPS, new List <double>() { 0.0333, 0.0166, 0.0133, 0.0111, 0.0083, 0.0069, 0.0041 }, FuncParser.doubleRead(FormMain.pathSkyrimINI, "HAVOK", "fMaxTime"), false, comboBoxPredictFPS_SelectedIndexChanged); }
//////////////////////////////////////////////////////ГРАНИЦА ФУНКЦИИ////////////////////////////////////////////////////////////// private void EnableDisableButtons() { if (updatesFound) { if (stopDownload) { comboBox1.Enabled = false; buttonAboutU.Enabled = false; buttonCvsU.Text = buttonCvsU_TS; } else { comboBox1.Enabled = true; buttonAboutU.Enabled = true; label5.Text = label5_T + FuncParser.convertFileSize(FuncParser.doubleRead(updateFolder + nameUpdateInfo, "Update_" + numberSelectFile, "update_file_filesize")); if (updateInstall) { buttonCvsU.Enabled = false; buttonCvsU.Text = buttonCvsU_TI; } else { buttonCvsU.Enabled = true; buttonCvsU.Text = buttonCvsU_TU; } } } else { comboBox1.Enabled = false; buttonAboutU.Enabled = false; label5.Text = ""; if (stopDownload) { buttonCvsU.Text = buttonCvsU_TS; } else { buttonCvsU.Text = buttonCvsU_TC; } } if (updatesCPFound) { if (stopDownload) { buttonUpdateCP.Enabled = false; } else { buttonUpdateCP.Enabled = true; buttonUpdateCP.Text = buttonUpdateCP_TE; } } else { buttonUpdateCP.Enabled = false; buttonUpdateCP.Text = buttonUpdateCP_TN; } }
private bool checkUpdateVersion(int index) { if (FuncParser.doubleRead(pathUpdateFolder + nameUpdateInfo, "Update_" + index, "update_file_version") <= FuncParser.doubleRead(FormMain.pathLauncherINI, "Updates", "Update_" + index + "_Version")) { return(true); } return(false); }
private bool checkUpdateVersion(int index) { double UpdateVersion1 = FuncParser.doubleRead(updateFolder + nameUpdateInfo, "Update_" + index, "update_file_version"); if (UpdateVersion1 != -1) { double UpdateVersion2 = FuncParser.doubleRead(FormMain.iniLauncher, "Updates", "Update_" + index + "_Version"); if (UpdateVersion1 != -1) { if (UpdateVersion1 <= UpdateVersion2) { return(true); } } } return(false); }
private bool checkUpdateFile(bool fromDL) { if (File.Exists(updateFolder + "file" + numberSelectFile + ".rar") && File.Exists(updateFolder + nameUpdateInfo) && File.Exists(FormMain.launcherFolder + "UnRAR.exe")) { if (new FileInfo(updateFolder + "file" + numberSelectFile + ".rar").Length == FuncParser.doubleRead(updateFolder + nameUpdateInfo, "Update_" + numberSelectFile, "update_file_filesize")) { return(true); } else { if (fromDL) { MessageBox.Show(notSyncWithUI); } FuncFiles.Delete(updateFolder + "file" + numberSelectFile + ".rar"); } } else { if (fromDL) { MessageBox.Show(noTools); } } return(false); }
// ------------------------------------------------ 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(); } } }