public void Refresh() { //Logging Start Logger.ProgressValue = 0; Logger.IsIndeterminate = true; Logger.Status = "Refreshing..."; Logger.Log = ""; IsInitialized = false; ModsList.Clear(); bool initProfiles = GetProfileInfo(); if (initProfiles) { WorkspaceViewModel wvm = (WorkspaceViewModel)AnchorablesSource.First(x => x.ContentId == "mods"); //FIXME check for updates wvm.GetModDataAsync(); Logger.LogString($"Refreshed Modlist."); } //Logging End Logger.ProgressValue = 100; Logger.IsIndeterminate = false; Logger.Status = "Finished."; Logger.NotifyStatusChanged(); }
private void ChangeActiveProfile(Dos2ModsSettings profile) { // FIXME bad check if (profile == null) { return; } //get old profile var id = profile.UUID; Profiles.FirstOrDefault(x => x.IsActive).IsActive = false; Profiles.FirstOrDefault(x => x.UUID == id).IsActive = true; //write to the lsb // FIXME I don't want this here //go into workspace view model and apply view if (AnchorablesSource != null) { WorkspaceViewModel wvm = (WorkspaceViewModel)AnchorablesSource.First(x => x.ContentId == "mods"); if (wvm != null) { wvm.ApplyModSettings(ActiveProfile); } } }
public void NotifyModChanged() { if (AnchorablesSource != null) { ConflictsViewModel cvm = (ConflictsViewModel)AnchorablesSource.First(x => x.ContentId == "conflicts"); if (cvm != null) { cvm.RegenerateConflictsList(); } } }
public void Save() { WorkspaceViewModel wvm = (WorkspaceViewModel)AnchorablesSource.First(x => x.ContentId == "mods"); //var dbg = wvm.ModsCollectionView.CurrentItem; //wvm.ModsCollectionView.CommitEdit(); //wvm.ModsCollectionView.Refresh(); //Logging Start Logger.ProgressValue = 0; Logger.IsIndeterminate = true; Logger.Status = "Saving..."; Dos2.ModManager.Properties.Settings.Default.Save(); MessageBoxResult result = MessageBox.Show( "Save current load order? This operation cannot be undone.", "Save Load Order?", MessageBoxButton.OKCancel, MessageBoxImage.Warning); if (result == MessageBoxResult.OK) { lt.SaveModSettings(ActiveProfile, ModsList.ToList()); // refresh //FIXME this should be redundant bool initProfiles = GetProfileInfo(); if (initProfiles) { //FIXME check for updates wvm.GetModDataAsync(); } Logger.LogString($"Saved Modlist for profile {ActiveProfile.Name}."); } else { MessageBoxResult viper = MessageBox.Show("You'll coward don't even smoke crack."); // do noting } //Logging End Logger.ProgressValue = 100; Logger.IsIndeterminate = false; Logger.LogString("Finished Saving."); Logger.NotifyStatusChanged(); }