public void Backup(bool restoreOriginal = false) { // backup files from raw data path to the mod directory ModDataSynchronizer synchronizer = DataSynchronizer; synchronizer.BackupToMod(); if (restoreOriginal) { ModTools.RestoreOriginalData(synchronizer.ChangedFiles); } }
private void RestoreOriginalData(object sender, EventArgs e) { if (SelectedMod != null) { if (MessageBox.Show("This will undo all changes for the currently set mod.\nContinue?", "Really restore data?", MessageBoxButtons.OKCancel) == DialogResult.Cancel) { return; } } ModTools.RestoreOriginalData(); }
/* * Remove the given mod from the list. */ public void DeleteMod(Mod mod) { if (mods.Remove(mod)) { if (mod == CurrentMod) { // prevent the mod from backing up its data upon deactivation // if it is the current mod currentMod = null; ModTools.RestoreOriginalData(); if (CurrentModSet != null) { CurrentModSet(); } } ModListChanged(); Directory.Delete(mod.ModDirectory, true); } }