Beispiel #1
0
 private void TryChangeGameTo(Mod.MEGame newgame)
 {
     if (newgame == SelectedGame)
     {
         return;                          //don't care
     }
     if (ModsInGroup.Count > 0 && newgame != SelectedGame)
     {
         var result = M3L.ShowDialog(this, M3L.GetString(M3L.string_dialog_changingGameWillClearGroup), M3L.GetString(M3L.string_changingGameWillClearGroup), MessageBoxButton.YesNo, MessageBoxImage.Warning);
         if (result == MessageBoxResult.Yes)
         {
             ModsInGroup.ClearEx();
             SelectedGame = newgame;
         }
         else
         {
             //reset choice
             SetGameRadioUI(SelectedGame); //reset back
         }
     }
     else
     {
         SelectedGame = newgame;
     }
 }
Beispiel #2
0
        private void RemoveFromInstallGroup()
        {
            Mod m = SelectedInstallGroupMod;

            if (ModsInGroup.Remove(m))
            {
                VisibleFilteredMods.Add(m);
            }
        }
Beispiel #3
0
        private void AddToInstallGroup()
        {
            Mod m = SelectedAvailableMod;

            if (VisibleFilteredMods.Remove(m))
            {
                ModsInGroup.Add(m);
            }
        }
Beispiel #4
0
 private void MoveUp()
 {
     if (SelectedInstallGroupMod != null)
     {
         var mod      = SelectedInstallGroupMod;
         var oldIndex = ModsInGroup.IndexOf(SelectedInstallGroupMod);
         var newIndex = oldIndex - 1;
         ModsInGroup.RemoveAt(oldIndex);
         ModsInGroup.Insert(newIndex, mod);
         SelectedInstallGroupMod = mod;
     }
 }
Beispiel #5
0
 private bool CanMoveDown()
 {
     if (SelectedInstallGroupMod != null)
     {
         var index = ModsInGroup.IndexOf(SelectedInstallGroupMod);
         if (index < ModsInGroup.Count - 1)
         {
             return(true);
         }
     }
     return(false);
 }
Beispiel #6
0
 private bool CanMoveUp()
 {
     if (SelectedInstallGroupMod != null)
     {
         var index = ModsInGroup.IndexOf(SelectedInstallGroupMod);
         if (index > 0)
         {
             return(true);
         }
     }
     return(false);
 }
Beispiel #7
0
 public BatchModQueueEditor(List <Mod> allMods, Window owner = null, BatchLibraryInstallQueue queueToEdit = null)
 {
     Owner        = owner;
     DataContext  = this;
     this.allMods = allMods;
     LoadCommands();
     InitializeComponent();
     if (queueToEdit != null)
     {
         existingFilename = queueToEdit.BackingFilename;
         SetGameRadioUI(queueToEdit.Game);
         SelectedGame     = queueToEdit.Game;
         GroupName        = queueToEdit.QueueName;
         GroupDescription = queueToEdit.QueueDescription;
         ModsInGroup.ReplaceAll(queueToEdit.ModsToInstall);
         VisibleFilteredMods.RemoveRange(queueToEdit.ModsToInstall);
     }
 }
Beispiel #8
0
 private bool CanSave() => ModsInGroup.Any() && !string.IsNullOrWhiteSpace(GroupName) && !string.IsNullOrWhiteSpace(GroupDescription);