Skip to content

Commit 6fd7e88

Browse files
committed
[FlashpointManager] Don't show dependency prompt when auto-downloading components
1 parent 973bbac commit 6fd7e88

2 files changed

Lines changed: 23 additions & 19 deletions

File tree

FlashpointManager/src/Common.cs

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -475,37 +475,41 @@ void AddDependencies(string[] depends)
475475
}
476476
});
477477

478-
if (alertDepends)
478+
if (persistDepends.Count > 0)
479479
{
480-
if (persistDepends.Count > 0)
480+
if (alertDepends)
481481
{
482482
MessageBox.Show(
483483
"The following components cannot be removed because one or more components depend on them:\n\n" +
484484
string.Join(", ", persistDepends), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error
485485
);
486-
487-
return false;
488486
}
489487

490-
if (missingDepends.Count > 0)
491-
{
492-
long missingSize = missingDepends.Select(n => (n.Tag as Component).Size).Sum();
488+
return false;
489+
}
493490

494-
var result = MessageBox.Show(
491+
if (missingDepends.Count > 0)
492+
{
493+
long missingSize = missingDepends.Select(n => (n.Tag as Component).Size).Sum();
494+
var result = DialogResult.Yes;
495+
496+
if (alertDepends)
497+
{
498+
result = MessageBox.Show(
495499
"The following dependencies will also be installed:\n\n" +
496500
string.Join(", ", missingDepends.Select(n => (n.Tag as Component).Title)) + "\n\n" +
497-
$"This adds an additional {GetFormattedBytes(missingSize)} to your download. Is this OK?",
501+
$"This will add {GetFormattedBytes(missingSize)} to your download. Is this OK?",
498502
"Notice", MessageBoxButtons.YesNo, MessageBoxIcon.Information
499503
);
504+
}
500505

501-
if (result == DialogResult.Yes)
502-
{
503-
missingDepends.ForEach(d => d.Checked = true);
504-
}
505-
else
506-
{
507-
return false;
508-
}
506+
if (result == DialogResult.Yes)
507+
{
508+
missingDepends.ForEach(d => d.Checked = true);
509+
}
510+
else
511+
{
512+
return false;
509513
}
510514
}
511515

FlashpointManager/src/Forms/Main.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ private void Main_Load(object sender, EventArgs e)
4747
}
4848

4949
FPM.CheckDependencies(false);
50-
ChangeButton_Click(this, new EventArgs());
50+
new Operate() { TopMost = true }.ShowDialog();
5151

5252
Close();
5353
}
@@ -116,7 +116,7 @@ private void ChangeButton_Click(object sender, EventArgs e)
116116

117117
FPM.UpdateMode = false;
118118

119-
var operationWindow = new Operate() { TopMost = FPM.AutoDownload.Count > 0 };
119+
var operationWindow = new Operate();
120120
operationWindow.ShowDialog();
121121
}
122122

0 commit comments

Comments
 (0)