public static bool AnyGamesConfigured() { // sadx validity check string sadxpcfailreason = ""; bool sadxPCIsValid = GamePathChecker.CheckSADXPCValid(settings.SADXPCPath, out sadxpcfailreason); // sa2 valididty check next string sa2pcFailReason = ""; bool sa2PCIsValid = GamePathChecker.CheckSA2PCValid(settings.SA2PCPath, out sa2pcFailReason); return(sadxPCIsValid || sa2PCIsValid); }
private void GameConfig_FormClosing(object sender, FormClosingEventArgs e) { if (this.DialogResult == DialogResult.Abort) { return; } SaveSettings(); // check validitiy // check validity string sadxFailReason = ""; bool sadxpcValid = GamePathChecker.CheckSADXPCValid( Program.Settings.SADXPCPath, out sadxFailReason); if (!sadxpcValid) { MessageBox.Show(sadxFailReason, "SADX PC Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } string sa2PCFailReason = ""; bool sa2PCValid = GamePathChecker.CheckSA2PCValid( Program.Settings.SA2PCPath, out sa2PCFailReason); if (!sa2PCValid) { MessageBox.Show(sa2PCFailReason, "SA2 PC Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } if (!Program.AnyGamesConfigured()) { DialogResult dialogResult = MessageBox.Show("No games configured", "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); if (dialogResult == DialogResult.Cancel) { this.DialogResult = DialogResult.Abort; e.Cancel = false; Application.Exit(); return; } else { return; } } e.Cancel = true; this.Hide(); }
public NewProject() { InitializeComponent(); sadxIsValid = GamePathChecker.CheckSADXPCValid( Program.Settings.SADXPCPath, out string sadxInvalidReason); sa2pcIsValid = GamePathChecker.CheckSA2PCValid( Program.Settings.SA2PCPath, out string sa2pcInvalidReason); backgroundWorker1.RunWorkerCompleted += BackgroundWorker1_RunWorkerCompleted; SADXPCButton.Checked = (sadxIsValid); SA2RadioButton.Checked = (false); SetControls(); }
void SetControls() { // check valid states again sadxIsValid = GamePathChecker.CheckSADXPCValid( Program.Settings.SADXPCPath, out string sadxInvalidReason); sa2pcIsValid = GamePathChecker.CheckSA2PCValid( Program.Settings.SA2PCPath, out string sa2pcInvalidReason); ProjectNameBox.Enabled = true; SA2RadioButton.Enabled = sa2pcIsValid; SADXPCButton.Enabled = sadxIsValid; BackButton.Enabled = true; AuthorTextBox.Enabled = true; DescriptionTextBox.Enabled = true; ControlBox = true; NextButton.Enabled = (ProjectNameBox.Text.Length > 0); }