/// <summary> /// Handles the <see cref="Control.Click"/> event of the override button. /// </summary> /// <remarks> /// This marks the entered path as the path to use as the installation path for the game mode, /// override any found paths. /// </remarks> /// <param name="sender">The object that raised the event.</param> /// <param name="e">An <see cref="EventArgs"/> describing the event arguments.</param> private void butOverride_Click(object sender, EventArgs e) { if (Discoverer.Verify(GameMode.ModeId, tbxInstallPath.Text) || MessageBox.Show(this, "The selected path does not contain the game's EXE file. Are you sure you want to use the selected path?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { Discoverer.Override(GameMode.ModeId, tbxInstallPath.Text); DisplayFinalUI(); } }
/// <summary> /// Handles the <see cref="Control.TextChanged"/> event of the install path text box. /// </summary> /// <remarks> /// This verifies that the entered path contains the game being looked for, dislpaying /// an error if required. /// </remarks> /// <param name="sender">The object that raised the event.</param> /// <param name="e">An <see cref="EventArgs"/> describing the event arguments.</param> private void tbxInstallPath_TextChanged(object sender, EventArgs e) { butOverride.Enabled = tbxInstallPath.Text.Length > 0; if (!Discoverer.Verify(GameMode.ModeId, tbxInstallPath.Text)) { erpErrors.SetError(butSelectPath, "Path does not contain game EXE."); } else { erpErrors.SetError(butSelectPath, null); } }