From a1f4289da1022edeebeb36a640561fcceb0f0866 Mon Sep 17 00:00:00 2001 From: Bitl Date: Sun, 21 Aug 2022 09:58:14 -0700 Subject: [PATCH] we Quake now --- .../Compact/LauncherFormCompact.Designer.cs | 5 ++++- .../Compact/LauncherFormCompact.cs | 16 +++++++++++++++ .../Compact/LauncherFormCompact.resx | 2 +- .../Extended/LauncherFormExtended.Designer.cs | 3 +++ .../Extended/LauncherFormExtended.cs | 20 +++++++++++++++++-- .../Extended/LauncherFormExtended.resx | 2 +- .../Forms/LauncherForm/LauncherFormShared.cs | 12 ++++++++++- 7 files changed, 54 insertions(+), 6 deletions(-) diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.Designer.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.Designer.cs index e974425..07f53c4 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.Designer.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.Designer.cs @@ -196,6 +196,7 @@ namespace NovetusLauncher this.tabControl1.Size = new System.Drawing.Size(413, 284); this.tabControl1.TabIndex = 1; this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged); + this.tabControl1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.launcherForm_KeyDown); // // tabPage1 // @@ -354,6 +355,7 @@ namespace NovetusLauncher this.textBox1.Text = "localhost"; this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.textBox1.TextChanged += new System.EventHandler(this.TextBox1TextChanged); + this.textBox1.Enter += new System.EventHandler(this.textBox1_GotFocus); // // tabPage2 // @@ -887,7 +889,7 @@ namespace NovetusLauncher this.richTextBox1.Name = "richTextBox1"; this.richTextBox1.Size = new System.Drawing.Size(399, 255); this.richTextBox1.TabIndex = 2; - this.richTextBox1.Text = "TEST"; + this.richTextBox1.Text = ""; this.richTextBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.richTextBox1_KeyDown); // // tabPage8 @@ -1517,6 +1519,7 @@ namespace NovetusLauncher launcherForm.IPBox = textBox1; launcherForm.ServerBrowserNameBox = textBox7; launcherForm.ServerBrowserAddressBox = textBox8; + launcherForm.ConsolePage = tabPage7; } private System.Windows.Forms.CheckBox checkBox4; diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs index a94c12a..ba361d2 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs @@ -66,8 +66,19 @@ namespace NovetusLauncher launcherForm.CloseEvent(e); } + private void textBox1_GotFocus(object sender, EventArgs e) + { + launcherForm.OldIP = textBox1.Text; + } + void TextBox1TextChanged(object sender, EventArgs e) { + if (textBox1.Text.Contains("`")) + { + textBox1.Text = launcherForm.OldIP; + return; + } + GlobalVars.IP = textBox1.Text; checkBox3.Enabled = false; GlobalVars.LocalPlayMode = false; @@ -174,6 +185,11 @@ namespace NovetusLauncher launcherForm.ProcessConsole(e); } + void launcherForm_KeyDown(object sender, KeyEventArgs e) + { + launcherForm.SwapToConsole(e); + } + void NumericUpDown1ValueChanged(object sender, EventArgs e) { launcherForm.ChangeJoinPort(); diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.resx b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.resx index 1ed133b..0aab3fc 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.resx +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.resx @@ -136,7 +136,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAB0 - CQAAAk1TRnQBSQFMAgEBAgEAAWABAAFgAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CQAAAk1TRnQBSQFMAgEBAgEAAXgBAAF4AQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.Designer.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.Designer.cs index 1ac5083..68384d4 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.Designer.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.Designer.cs @@ -461,6 +461,7 @@ namespace NovetusLauncher this.tabControl1.TabIndex = 1; this.tabControl1.TabStop = false; this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged); + this.tabControl1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.launcherForm_KeyDown); // // tabPage1 // @@ -615,6 +616,7 @@ namespace NovetusLauncher this.textBox1.Text = "localhost"; this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.textBox1.TextChanged += new System.EventHandler(this.TextBox1TextChanged); + this.textBox1.Enter += new System.EventHandler(this.textBox1_GotFocus); // // tabPage2 // @@ -1492,6 +1494,7 @@ namespace NovetusLauncher launcherForm.IPBox = textBox1; launcherForm.ServerBrowserNameBox = textBox7; launcherForm.ServerBrowserAddressBox = textBox8; + launcherForm.ConsolePage = tabPage7; } private System.Windows.Forms.CheckBox checkBox4; diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs index f666061..f2c7f56 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs @@ -70,9 +70,20 @@ namespace NovetusLauncher { launcherForm.CloseEvent(e); } - + + private void textBox1_GotFocus(object sender, EventArgs e) + { + launcherForm.OldIP = textBox1.Text; + } + void TextBox1TextChanged(object sender, EventArgs e) { + if (textBox1.Text.Contains("`")) + { + textBox1.Text = launcherForm.OldIP; + return; + } + GlobalVars.IP = textBox1.Text; checkBox3.Enabled = false; GlobalVars.LocalPlayMode = false; @@ -178,7 +189,12 @@ namespace NovetusLauncher { launcherForm.ProcessConsole(e); } - + + void launcherForm_KeyDown(object sender, KeyEventArgs e) + { + launcherForm.SwapToConsole(e); + } + void NumericUpDown1ValueChanged(object sender, EventArgs e) { launcherForm.ChangeJoinPort(); diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.resx b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.resx index 9900a5b..f6a5bd4 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.resx +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.resx @@ -136,7 +136,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAB0 - CQAAAk1TRnQBSQFMAgEBAgEAAaABAAGgAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CQAAAk1TRnQBSQFMAgEBAgEAAdABAAHQAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs index d8532e1..e67d276 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs @@ -49,6 +49,7 @@ namespace NovetusLauncher public Settings.Style FormStyle = Settings.Style.None; public RichTextBox ConsoleBox, ChangelogBox, ReadmeBox = null; public TabControl Tabs = null; + public TabPage ConsolePage = null; public TextBox MapDescBox, ServerInfo, SearchBar, PlayerIDTextBox, PlayerNameTextBox, ClientDescriptionBox, IPBox, ServerBrowserNameBox, ServerBrowserAddressBox = null; public TreeView Tree, _TreeCache = null; @@ -59,7 +60,7 @@ namespace NovetusLauncher public CheckBox CloseOnLaunchCheckbox, DiscordPresenceCheckbox, uPnPCheckBox, ShowServerNotifsCheckBox, LocalPlayCheckBox = null; public Button RegeneratePlayerIDButton = null; public NumericUpDown PlayerLimitBox, HostPortBox, JoinPortBox = null; - public string TabPageHost, TabPageMaps, TabPageClients, TabPageSaved = ""; + public string TabPageHost, TabPageMaps, TabPageClients, TabPageSaved, OldIP = ""; private ToolTip contextToolTip; #endregion @@ -712,6 +713,15 @@ namespace NovetusLauncher } } + public void SwapToConsole(KeyEventArgs e) + { + if (e.KeyCode == Keys.Oemtilde) + { + Tabs.SelectedTab = ConsolePage; + e.Handled = true; + } + } + public void SetupImportantData() { CryptoRandom random = new CryptoRandom();