Skip to content

Commit

Permalink
Fix random github error
Browse files Browse the repository at this point in the history
Re-push update to files

Co-Authored-By: Ryan Walpole <[email protected]>
  • Loading branch information
RWELabs and RyanWalpole committed Jun 7, 2022
1 parent 903b40f commit 40f54f1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,13 @@ public MPInstaller()

foreach (string folder in Directory.GetDirectories(UnpackLocation))
{
if(Directory.Exists(Properties.Settings.Default.InactiveModsDir + Path.GetFileName(folder)))
if (Directory.Exists(Properties.Settings.Default.InactiveModsDir + Path.GetFileName(folder)))
{
OverwriteMods.Items.Add(Path.GetFileName(folder));
}

ModsToInstall.Items.Add(Path.GetFileName(folder));
}

}

private void MPInstaller_FormClosed(object sender, FormClosedEventArgs e)
Expand All @@ -66,6 +65,7 @@ private void DoModInstall_DoWork(object sender, DoWorkEventArgs e)
string AppData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
string SDVAppData = AppData + @"\RWE Labs\SDV Mod Manager\";
string UnpackLocation = SDVAppData + @"\tmp\unpack\";
//string ModsOld = Properties.Settings.Default.StardewDir + @"\vdsk\";

foreach (string folder in Directory.GetDirectories(UnpackLocation))
{
Expand All @@ -74,30 +74,49 @@ private void DoModInstall_DoWork(object sender, DoWorkEventArgs e)
Directory.Delete(Properties.Settings.Default.InactiveModsDir + Path.GetFileName(folder), true);
}
}
}

foreach (string folder in Directory.GetDirectories(UnpackLocation))
private void DoModInstall_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
DoMovementOperation.Start();
}

private void DoMovementOperation_Tick(object sender, EventArgs e)
{
DoMovementOperation.Stop();
DoModDelete.RunWorkerAsync();
}

private void DoModDelete_DoWork(object sender, DoWorkEventArgs e)
{

string AppData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
string SDVAppData = AppData + @"\RWE Labs\SDV Mod Manager\";
string UnpackLocation = SDVAppData + @"\tmp\unpack\";

foreach (string folder in Directory.GetDirectories(Path.GetFullPath(UnpackLocation)))
{
Directory.Move(folder, Properties.Settings.Default.InactiveModsDir + Path.GetFileName(folder));//
Directory.Move(folder, Properties.Settings.Default.InactiveModsDir + Path.GetFileName(folder));
}
}

private void DoModInstall_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
private void DoModDelete_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
string PresetName = Path.GetFileNameWithoutExtension(Properties.Settings.Default.LaunchArguments);

foreach(string item in ModsToInstall.Items)
foreach (string item in ModsToInstall.Items)
{
PresetGenerator.AppendText(item + Environment.NewLine);
}

PresetGenerator.AppendText("ConsoleCommands"+ Environment.NewLine);
PresetGenerator.AppendText("ConsoleCommands" + Environment.NewLine);
PresetGenerator.AppendText("ErrorHandler" + Environment.NewLine);
PresetGenerator.AppendText("SaveBackup" + Environment.NewLine);

PresetGenerator.SaveFile(Properties.Settings.Default.PresetsDir + PresetName + ".txt", RichTextBoxStreamType.PlainText);

DialogResult dr = MessageBox.Show("The modpack has been successfully installed. We've added a preset so you can easily one-click enable this modpack. The preset is called: " + PresetName + Environment.NewLine + Environment.NewLine + "Would you like to open the Stardew Valley Mod Manager now, to re-enable your mods?", "Stardew Valley Mod Manager", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if(dr == DialogResult.Yes)
if (dr == DialogResult.Yes)
{
this.Hide();

Expand All @@ -116,4 +135,4 @@ private void DoModInstall_RunWorkerCompleted(object sender, RunWorkerCompletedEv
}
}
}
}
}
Binary file not shown.

0 comments on commit 40f54f1

Please sign in to comment.