public static int ShowBasicButton(this Form frm, string labelText, string button1text, string button2text, string button3text) { BasicButtonPopup basicButtonPrompt = GetBasicButton(frm, labelText, button1text, button2text, button3text); basicButtonPrompt.ShowDialog(); return(basicButtonPrompt.ResultButton); }
private void Form1_Load(object sender, EventArgs e) { dataGridView1.ClearSelection(); if (!string.IsNullOrEmpty(Program.CommandLineOptions.NextLaunchPath)) { ModManager.LaunchCommand = Program.CommandLineOptions.NextLaunchPath; Program.CommandLineOptions.NextLaunchPath = null; ModManager.SyncConfigToDisk(); } // Fetch the latest version from github Task.Run(() => { latestOnlineVersion = GitHubAPI.GetLatestVersionFromGitHub(GitHubRepo); }).ContinueWith(res => { if (latestOnlineVersion != null && latestOnlineVersion.IsAMLVersionLower()) { BasicButtonPopup resultButton = this.GetBasicButton("A new version of AstroModLoader (v" + latestOnlineVersion + ") is available!", "OK", "Open in browser", null); resultButton.PageToVisit = GitHubAPI.GetLatestVersionURL(GitHubRepo); resultButton.ShowDialog(); } }, TaskScheduler.FromCurrentSynchronizationContext()); // Initial resize of the menu to fit the table if necessary AMLUtils.InvokeUI(ForceTableToFit); AMLUtils.InvokeUI(ForceResize); AMLUtils.InvokeUI(ForceResize); UpdateVersionLabel(); RefreshModInfoLabel(); }