Skip to content

Commit 001bac0

Browse files
committed
[FlashpointManager] Check for dependencies when auto-downloading components
1 parent cbaf827 commit 001bac0

2 files changed

Lines changed: 20 additions & 15 deletions

File tree

FlashpointManager/src/Common.cs

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ public static void VerifySourcePath()
433433
}
434434

435435
// Checks if any dependencies were not marked for download by the user, and marks them accordingly
436-
public static bool CheckDependencies()
436+
public static bool CheckDependencies(bool alertDepends = true)
437437
{
438438
List<string> requiredDepends = new List<string>();
439439
List<string> persistDepends = new List<string>();
@@ -481,23 +481,26 @@ public static bool CheckDependencies()
481481
}
482482
});
483483

484-
if (persistDepends.Count > 0)
484+
if (alertDepends)
485485
{
486-
MessageBox.Show(
487-
"The following components cannot be removed because one or more components depend on them:\n\n" +
488-
string.Join(", ", persistDepends), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error
489-
);
486+
if (persistDepends.Count > 0)
487+
{
488+
MessageBox.Show(
489+
"The following components cannot be removed because one or more components depend on them:\n\n" +
490+
string.Join(", ", persistDepends), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error
491+
);
490492

491-
return false;
492-
}
493+
return false;
494+
}
493495

494-
if (missingDepends.Count > 0)
495-
{
496-
MessageBox.Show(
497-
"The following dependencies will also be installed:\n\n" +
498-
string.Join(", ", missingDepends) + "\n\nClick the OK button to proceed.",
499-
"Notice", MessageBoxButtons.OK, MessageBoxIcon.Information
500-
);
496+
if (missingDepends.Count > 0)
497+
{
498+
MessageBox.Show(
499+
"The following dependencies will also be installed:\n\n" +
500+
string.Join(", ", missingDepends) + "\n\nClick the OK button to proceed.",
501+
"Notice", MessageBoxButtons.OK, MessageBoxIcon.Information
502+
);
503+
}
501504
}
502505

503506
return true;

FlashpointManager/src/Forms/Main.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ private void Main_Load(object sender, EventArgs e)
4343
if (query.Length > 0 && !query[0].Checked)
4444
{
4545
query[0].Checked = true;
46+
FPM.CheckDependencies(false);
47+
4648
ChangeButton_Click(this, new EventArgs());
4749
}
4850

0 commit comments

Comments
 (0)