public static void modify_prop() { Console.WriteLine("Server Type:\n1) Vanilla\n2) Spigot\nPress any other key to return"); var stype = Console.ReadKey().KeyChar; if (stype < '1' || stype > '2') { return; } Console.Clear(); Console.SetCursorPosition(0, 1); Console.Write("Type 'back' to return"); Console.SetCursorPosition(0, 0); Console.Write("Server Version: "); var str = Console.ReadLine(); Console.Clear(); if (str.ToLower() == "back") { return; } Console.WriteLine("Server Version: " + str); if (str.ToLower() == "latest") { MessageBox.Show("Using 'latest' is no longer supported"); } // str = GetLatest(); CheckServerF(); string sStypeString = (stype == '1' ? "Vanilla/" : "Spigot/"); if (Directory.Exists("Servers/" + sStypeString + str)) { var pe = new PropertiesEditor("Servers/" + sStypeString + str); pe.Text = "Properties Editor - " + (stype == '1' ? "Vanilla" : "Spigot") + " " + str; pe.ShowDialog(); pe.Dispose(); } else { if (!bUseGUI) { Console.WriteLine("Couldn't find version!\nPress any button to continue"); Console.ReadKey(); } else { Console.WriteLine("Couldn't find version!"); } } }
private void Button3_Click(object sender, EventArgs e) { if (tbVersion.Text == "Timotainment") { ProcessStartInfo a = new ProcessStartInfo("explorer", "https://www.youtube.com/embed/CBb2AsiFhsA"); Process.Start(a); return; } if (!bModifyProp) { switch (clbSType.CheckedItems[0].ToString()) { case "Vanilla": Program.start_server_vanilla(tbVersion.Text, false); GetVersions("Vanilla"); break; case "Spigot": /* * if(!Program.bAskedGit) * { * DialogResult dg = MessageBox.Show("Git is highly reccomended when downloading spigot servers, would you like to open the page to download Git?", "Download Git?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); * if (dg == DialogResult.Yes) * Process.Start("explorer", "https://gitforwindows.org/"); * Program.bAskedGit = true; * } */ Program.start_server_spigot(tbVersion.Text, false); GetVersions("Spigot"); break; default: Program.launch(clbSType.CheckedItems[0].ToString(), tbVersion.Text); GetVersions(clbSType.CheckedItems[0].ToString()); break; } } else { PropertiesEditor pe = new PropertiesEditor("Servers/" + clbSType.CheckedItems[0].ToString() + "/" + lbVersion.Text) { Text = "Properties Editor - " + (clbSType.CheckedItems[0].ToString()) + " " + tbVersion.Text }; pe.ShowDialog(); pe.Dispose(); } }