private void CheckBackupState() { bool backupExists = BackupManager.OriginalsExist(); { buttonRestoreOriginals.Enabled = backupExists; } }
private void buttonRestoreOriginals_Click(object sender, EventArgs e) { var restoreData = MessageBox.Show("Your original backup files will be restored, and any SnakeBite settings and mods will be completely removed.\n\nAre you sure you want to continue?", "SnakeBite", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (restoreData == DialogResult.No) { return; } if (BackupManager.OriginalsExist()) { BackupManager.RestoreOriginals(); SettingsManager.DeleteSettings(); Application.Exit(); } }
private void CheckBackupState() { if (BackupManager.OriginalsExist()) { labelNoBackups.Text = ""; buttonRestoreOriginals.Enabled = true; } else { if (BackupManager.OriginalZeroOneExist()) { labelNoBackups.Text = "chunk0 backup not detected.\nCannot restore backup game files."; buttonRestoreOriginals.Enabled = false; picModToggle.Enabled = true; } else { labelNoBackups.Text = "No backups detected.\nCertain features are unavailable."; buttonRestoreOriginals.Enabled = false; picModToggle.Enabled = false; picModToggle.Image = Properties.Resources.toggledisabled; } } }