diff --git a/RoR2VersionSelector/RoR2VersionSelector.cs b/RoR2VersionSelector/RoR2VersionSelector.cs index ac4104028..178025f86 100644 --- a/RoR2VersionSelector/RoR2VersionSelector.cs +++ b/RoR2VersionSelector/RoR2VersionSelector.cs @@ -91,10 +91,32 @@ private void RoR2VersionSelector_Load(object sender, EventArgs e) UpdateInitialState(); } + private Boolean ValidateInput() + { + if (TextBoxUsername.Text.Length == 0) + { + MessageBox.Show("Please specify username.", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Information); + return false; + } + + if (!Enum.IsDefined(typeof(RoR2Versions), ComboBoxVersionSelector.Text)) + { + MessageBox.Show("Please specify valid version.", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Information); + return false; + } + + return true; + } + private async void ButtonDownloadDepot_Click(object sender, EventArgs e) { + if (!ValidateInput()) + { + return; + } ButtonDownloadDepot.Enabled = false; + var startInfo = new ProcessStartInfo { FileName = "cmd.exe",