From 407724fb0d81f1497018b42ae48c540ae6b06b3d Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 18 Jun 2020 20:05:14 +0200 Subject: [PATCH] Don't complain if we don't know about the mod files --- GCMM/MainForm.cs | 6 ++++++ GCMM/MainModInstaller.cs | 7 +++++-- GCMM/Properties/Settings.Designer.cs | 12 ++++++++++++ GCMM/Properties/Settings.settings | 3 +++ README.md | 2 +- 5 files changed, 27 insertions(+), 3 deletions(-) diff --git a/GCMM/MainForm.cs b/GCMM/MainForm.cs index e266383..016d349 100644 --- a/GCMM/MainForm.cs +++ b/GCMM/MainForm.cs @@ -45,6 +45,12 @@ If you encounter an issue while the game is patched, report it to us. If you thi private void Form1_Load(object sender, EventArgs e) { + if (Settings.Default.NeedsUpdate) + { + Settings.Default.Upgrade(); + Settings.Default.NeedsUpdate = false; + Settings.Default.Save(); + } modlist.Items.Clear(); UpdateButton(installbtn, false); modinfobox.Text = defaultInfo; diff --git a/GCMM/MainModInstaller.cs b/GCMM/MainModInstaller.cs index 5eda2b2..0fda43a 100644 --- a/GCMM/MainModInstaller.cs +++ b/GCMM/MainModInstaller.cs @@ -87,8 +87,11 @@ namespace GCMM continue; } - if (File.Exists(completeFileName) && !mod.ModFiles.Contains(completeFileName) && file.FullName != "Plugins/" + mod.Name + ".dll") - { //If it's part of the mod files, then it's an update and it didn't originally exist in the game - the last condition is for dll->zip changes + if ((mod.Version == null || mod.ModFiles.Count != 0) //Negated: The mod is installed and we don't know about any of its files + && File.Exists(completeFileName) // OR it's a new file + && !mod.ModFiles.Contains(completeFileName) // OR it's known to be part of the mod already + && file.FullName != "Plugins/" + mod.Name + ".dll") // OR it's the plugin's DLL (dll->zip release) + { if (MessageBox.Show("The mod zip contains a file that exists as part of the game. Do you want to skip this file?\n" + file.FullName + "\nOnly choose No if it's part of a previous installation of the mod.", "File is part of the game", MessageBoxButtons.YesNo) == DialogResult.Yes) continue; } diff --git a/GCMM/Properties/Settings.Designer.cs b/GCMM/Properties/Settings.Designer.cs index a3582b4..fc3f037 100644 --- a/GCMM/Properties/Settings.Designer.cs +++ b/GCMM/Properties/Settings.Designer.cs @@ -58,5 +58,17 @@ namespace GCMM.Properties { this["UseProxy"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool NeedsUpdate { + get { + return ((bool)(this["NeedsUpdate"])); + } + set { + this["NeedsUpdate"] = value; + } + } } } diff --git a/GCMM/Properties/Settings.settings b/GCMM/Properties/Settings.settings index 9f011ed..25bd9a4 100644 --- a/GCMM/Properties/Settings.settings +++ b/GCMM/Properties/Settings.settings @@ -11,5 +11,8 @@ False + + True + \ No newline at end of file diff --git a/README.md b/README.md index 83160a4..fff60bc 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Gamecraft Mod Manager A manager that handles everything needed to use mods for Gamecraft. -**Note:** If you already have mods installed that have extra files, the mod manager will treat them as game files which will cause issues with updating the mod. To solve this, remove the mod files and install the mod through this application - or say No to each prompt while updating. +**Note:** If you already have a mod installed the manager won't know about what files it has until it's updated through GCMM. If you uninstall the mod before updating it, it'll only remove the plugin dll and then treat the other mod files as part of Gamecraft. ## Features * Download and run GCIPA if needed