Skip to content

Commit 0964374

Browse files
committed
Added options for updating patches
1 parent 502bb30 commit 0964374

File tree

3 files changed

+30
-5
lines changed

3 files changed

+30
-5
lines changed

Sonic-06-Mod-Manager/src/Environment3/Controls/UnifyMessenger.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,13 @@ public UnifyMessenger(string text, string caption, MessageBoxButtons buttons, Me
6666
case MessageBoxButtons.YesNoCancel:
6767
btn_Yes.Visible = true;
6868
btn_No.Visible = true;
69+
btn_Abort.Visible = true;
70+
btn_Abort.Text = "Yes";
71+
btn_Abort.BackColor = Color.LightGreen;
72+
btn_Yes.Text = "No";
73+
btn_Yes.BackColor = Color.Tomato;
6974
btn_OK.Text = "Cancel";
70-
btn_OK.BackColor = Color.Tomato;
75+
btn_OK.BackColor = SystemColors.ControlLightLight;
7176
break;
7277
case MessageBoxButtons.OKCancel:
7378
btn_Yes.Visible = true;

Sonic-06-Mod-Manager/src/Environment3/RushInterface.Designer.cs

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sonic-06-Mod-Manager/src/Environment3/RushInterface.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,27 @@ private async void SectionButton_Updates_Click(object sender, EventArgs e) {
14381438
// Fetch latest patches is clicked
14391439
else if (sender == SectionButton_FetchPatches) {
14401440
Properties.Settings.Default.General_LastPatchUpdate = DateTime.Now.Ticks;
1441-
await UpdatePatches();
1441+
1442+
DialogResult deleteOrNah = UnifyMessenger.UnifyMessage.ShowDialog("Do you want to delete all existing patches?\n\n" +
1443+
"" +
1444+
"Clicking No will overwrite existing patches with the latest instead.",
1445+
"Delete existing patches?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
1446+
1447+
if (deleteOrNah != DialogResult.Cancel)
1448+
{
1449+
// Answer: delete
1450+
if (deleteOrNah == DialogResult.Yes)
1451+
{
1452+
// Literally just nuke the whole folder
1453+
foreach (string file in Directory.GetFiles(Program.Patches, "*.mlua", SearchOption.TopDirectoryOnly))
1454+
{
1455+
File.Delete(file);
1456+
}
1457+
}
1458+
1459+
await UpdatePatches();
1460+
}
1461+
14421462
Properties.Settings.Default.Save();
14431463

14441464
// Reset update button for future checking

0 commit comments

Comments
 (0)