Skip to content

Commit

Permalink
macOS Hotfix: Require staging directory (#31)
Browse files Browse the repository at this point in the history
* macOS: Require staging directory

* Grammar
  • Loading branch information
daggintosh authored Nov 9, 2022
1 parent 58d9dd3 commit 47af7d6
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions UnionPatcher.Gui/Forms/ModeSelectionForm.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using System;
using System.IO;
using Eto.Drawing;
using Eto.Forms;

namespace LBPUnion.UnionPatcher.Gui.Forms;
namespace LBPUnion.UnionPatcher.Gui.Forms;

public class ModeSelectionForm : Form {
#region UI
Expand All @@ -23,10 +24,27 @@ public ModeSelectionForm() {
new TableCell(new Button(openFilePatcher) { Text = "File Patch (PS3/RPCS3)" })
),
},
};
};
}

private void openRemotePatcher(object sender, EventArgs e) {

private void openRemotePatcher(object sender, EventArgs e)
{
if (OSUtil.GetPlatform() == OSPlatform.OSX)
{
Gui.CreateOkDialog("Workaround", "UnionPatcher RemotePatcher requires a staging folder on macOS, please set this to the directory of the UnionPatcher app!");
SelectFolderDialog dialog = new SelectFolderDialog();
if (dialog.ShowDialog(this) != DialogResult.Ok)
{
Gui.CreateOkDialog("Workaround", "User did not specify a staging folder, aborting!");
return;
}
Directory.SetCurrentDirectory(dialog.Directory);
if (!Directory.Exists("scetool"))
{
Gui.CreateOkDialog("Workaround", "Invalid folder, remember to set the folder to the directory of the UnionPatcher app!");
return;
}
}
RemotePatchForm rpForm = new RemotePatchForm();
rpForm.Show();
rpForm.Closed += OnSubFormClose;
Expand Down

0 comments on commit 47af7d6

Please sign in to comment.