From 807b46eb22faf01fbfa3d0eb332f9b476c338dcb Mon Sep 17 00:00:00 2001 From: nzbr Date: Fri, 9 Oct 2020 22:29:47 +0200 Subject: [PATCH 1/3] Fix connect code input for 8 letter codes --- AmongUsCapture/UserForm.Designer.cs | 2 +- AmongUsCapture/UserForm.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AmongUsCapture/UserForm.Designer.cs b/AmongUsCapture/UserForm.Designer.cs index 2698ac20..e667afd1 100644 --- a/AmongUsCapture/UserForm.Designer.cs +++ b/AmongUsCapture/UserForm.Designer.cs @@ -256,7 +256,7 @@ private void InitializeComponent() this.ConnectCodeBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.ConnectCodeBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); this.ConnectCodeBox.Location = new System.Drawing.Point(6, 6); - this.ConnectCodeBox.Mask = ">AAAAAA"; + this.ConnectCodeBox.Mask = ">AAAAAAAA"; this.ConnectCodeBox.Name = "ConnectCodeBox"; this.ConnectCodeBox.Size = new System.Drawing.Size(115, 22); this.ConnectCodeBox.TabIndex = 0; diff --git a/AmongUsCapture/UserForm.cs b/AmongUsCapture/UserForm.cs index 4116e4d8..691ed758 100644 --- a/AmongUsCapture/UserForm.cs +++ b/AmongUsCapture/UserForm.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Drawing; @@ -259,7 +259,7 @@ private void doConnect(string url) private void ConnectCodeBox_TextChanged(object sender, EventArgs e) { - ConnectButton.Enabled = (ConnectCodeBox.Enabled && ConnectCodeBox.Text.Length == 6 && !ConnectCodeBox.Text.Contains(" ")); + ConnectButton.Enabled = (ConnectCodeBox.Enabled && ConnectCodeBox.Text.Length == 8 && !ConnectCodeBox.Text.Contains(" ")); } private void ConsoleTextBox_TextChanged(object sender, EventArgs e) From d07d747fad87f71141822d0f99be6e789e420d8d Mon Sep 17 00:00:00 2001 From: nzbr Date: Fri, 9 Oct 2020 22:33:05 +0200 Subject: [PATCH 2/3] Disable Connect-Button on launch --- AmongUsCapture/UserForm.Designer.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/AmongUsCapture/UserForm.Designer.cs b/AmongUsCapture/UserForm.Designer.cs index e667afd1..69f008f5 100644 --- a/AmongUsCapture/UserForm.Designer.cs +++ b/AmongUsCapture/UserForm.Designer.cs @@ -272,6 +272,7 @@ private void InitializeComponent() this.ConnectButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.ConnectButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); this.ConnectButton.Dock = System.Windows.Forms.DockStyle.Fill; + this.ConnectButton.Enabled = false; this.ConnectButton.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption; this.ConnectButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.ConnectButton.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); From 68cb62c9a201d2c833bd19571d23c0447b91be0b Mon Sep 17 00:00:00 2001 From: nzbr Date: Fri, 9 Oct 2020 22:34:29 +0200 Subject: [PATCH 3/3] Don't disable inputs on connect, but clear connect code --- AmongUsCapture/UserForm.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/AmongUsCapture/UserForm.cs b/AmongUsCapture/UserForm.cs index 691ed758..19c21946 100644 --- a/AmongUsCapture/UserForm.cs +++ b/AmongUsCapture/UserForm.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Drawing; @@ -211,9 +211,10 @@ private void GameStateChangedHandler(object sender, GameStateChangedEventArgs e) private void ConnectButton_Click(object sender, EventArgs e) { - ConnectCodeBox.Enabled = false; + /*ConnectCodeBox.Enabled = false; ConnectButton.Enabled = false; - URLTextBox.Enabled = false; + URLTextBox.Enabled = false;*/ + ConnectCodeBox.Clear(); var url = "http://localhost:8123"; if (URLTextBox.Text != "")