private void AddToModBulkThreaded(string[] files)
 {
     RunThreaded(() => {
         DisableUI();
     }, () => {
         try
         {
             AddToModBulk(files, UpdateProgress);
         }
         catch (Archive2RequirementsException exc)
         {
             MsgBox.ShowID("archive2InstallRequirements", MessageBoxIcon.Error);
             return(false);
         }
         catch (Archive2Exception exc)
         {
             MsgBox.ShowID("archive2Error", MessageBoxIcon.Error);
             return(false);
         }
         catch (Exception exc)
         {
             MsgBox.Get("failed").FormatText(exc.Message).Show(MessageBoxIcon.Error);
             return(false);
         }
         return(true);
     }, (success) => {
         EnableUI();
         UpdateSidePanel();
     });
 }
        private void buttonModAbstain_Click(object sender, EventArgs e)
        {
            if (editingBulk)
            {
                return;
            }

            if (this.editedMod.Version == "")
            {
                MsgBox.Show("Can't abstain from endorsing", "Please enter a version and try again.", MessageBoxIcon.Information);
                return;
            }

            if (!NexusMods.User.IsLoggedIn)
            {
                MsgBox.ShowID("nexusModsNotLoggedIn", MessageBoxIcon.Information);
                return;
            }

            if (this.editedMod.RemoteInfo != null)
            {
                if (this.editedMod.RemoteInfo.Abstain(this.editedMod.Version))
                {
                    UpdateSidePanel();
                }
            }
        }
예제 #3
0
        private void buttonGalleryDeleteThumbnails_Click(object sender, EventArgs e)
        {
            if (MsgBox.ShowID("galleryDeleteThumbnails", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                // Remove every image from memory:
                this.galleryImageList.Images.Clear();
                this.galleryImagePaths.Clear();
                this.listViewScreenshots.Items.Clear();

                // Delete thumbnails:
                String thumbnailsPath = Path.Combine(Shared.AppConfigFolder, "thumbnails", "screenshots");
                try
                {
                    Directory.Delete(thumbnailsPath, true);
                }
                catch (Exception ex)
                {
                    MessageBox.Show($"{ex.GetType().Name}: {ex.Message}", "Something went wrong", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                // Setup UI:
                this.labelGalleryTip.Visible = true;
            }
        }
 private void gameFolderToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (!this.game.ValidateGamePath())
     {
         MsgBox.ShowID("modsGamePathNotSet", MessageBoxIcon.Error);
         return;
     }
     Utils.OpenExplorer(this.game.GamePath);
 }
        public static void Save()
        {
            if (Shared.GamePath == null)
            {
                MsgBox.ShowID("modsGamePathNotSet", MessageBoxIcon.Error);
                return;
            }

            if (!Directory.Exists(Path.Combine(Shared.GamePath, "Mods")))
            {
                Directory.CreateDirectory(Path.Combine(Shared.GamePath, "Mods"));
            }

            Serialize().Save(Path.Combine(Shared.GamePath, "Mods", "remote.xml"));

            NexusMods.Profile.Save();
        }