Skip to content

Commit 38bea24

Browse files
committed
Further MM/Forum cleanup. Preventing undully Dialog Messages.
1 parent c6c30d8 commit 38bea24

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

Source/ModuleManagerWatchDog/GUI/SelectMMForkOptionBox.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace WatchDog.ModuleManager.GUI.Dialogs
2020
{
2121
internal static class SelectMMForkOptionBox
2222
{
23-
private readonly static string AMSG = "{0}\n\n KSP will close once you make a choice, so the fix takes effect.";
23+
private readonly static string AMSG = "{0}\n\nKSP will close once you make a choice, so the fix takes effect.";
2424
internal static void Show(KSPe.UI.OptionDialogBox.Option[] options)
2525
{
2626
KSPe.UI.OptionDialogBox.Show(

Source/ModuleManagerWatchDog/InstallChecker.cs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ internal void Execute()
3434
if (null == msg)
3535
msg = this.CheckModuleManager();
3636

37-
if (null == msg && SanityLib.IsEnforceable(1, 12))
37+
if (null == msg)
3838
{
3939
msg = this.CheckModuleManagerConflict112();
40-
if (null != msg)
40+
if (null != msg && !Globals.Instance.IsValid)
4141
{
4242
KSPe.UI.OptionDialogBox.Option[] options = new KSPe.UI.OptionDialogBox.Option[]
4343
{
@@ -67,7 +67,8 @@ internal void Execute()
6767

6868
private void Handle(string msg)
6969
{
70-
if ( null != msg && Globals.Instance.IsValid)
70+
Log.dbg("Handling {0}", msg);
71+
if ( ErrorMessage.Conflict.ERR_MSG.Equals(msg) && Globals.Instance.IsValid)
7172
{
7273
string msg2 = this.AutoFix();
7374
if (null != msg2)
@@ -88,6 +89,7 @@ private void Handle(string msg)
8889

8990
private void HandledAutoFix()
9091
{
92+
Log.dbg("HandledAutoFix");
9193
string msg = this.AutoFix();
9294
if (null != msg)
9395
GUI.Dialogs.ShowRebootTheGameAlertBox.Show(msg);
@@ -240,6 +242,19 @@ private string ForceMyFork()
240242
{
241243
Log.error("Unexpected error \"{0}\"caugh by ForceMyFork while handling {1}", e.Message, file.Name);
242244
}
245+
246+
string[] victims = new string[] {"ConfigCache", "ConfigSHA", "Physics", "TechTree" };
247+
foreach(string v in victims ) try
248+
{
249+
string fn = SIO.Path.Combine(GAMEDATA, string.Format("{0}.{1}", ASSEMBLY_NAME, v));
250+
if (SIO.File.Exists(fn)) SIO.File.Delete(fn);
251+
++deletedFiles;
252+
}
253+
catch (Exception e)
254+
{
255+
Log.error("Unexpected error \"{0}\"caugh by ForceMyFork while handling {1}", e.Message, v);
256+
}
257+
243258
Log.detail("Removing Forum's MM was {0}.", 0 == deletedFiles ? "unsucessful" : "sucessful");
244259
return 0 != deletedFiles ? ErrorMessage.ERR_MM_FORUMDELETED: null;
245260
}

0 commit comments

Comments
 (0)