Esempio n. 1
0
File: Mod.cs Progetto: etupper/PFM
        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);
            }
        }
Esempio n. 2
0
 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);
     }
 }