From 47af7d6929264705d3fbd7d263f297b48c2a765a Mon Sep 17 00:00:00 2001 From: Dagg Date: Wed, 9 Nov 2022 14:36:26 -0800 Subject: [PATCH] macOS Hotfix: Require staging directory (#31) * macOS: Require staging directory * Grammar --- UnionPatcher.Gui/Forms/ModeSelectionForm.cs | 26 +++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/UnionPatcher.Gui/Forms/ModeSelectionForm.cs b/UnionPatcher.Gui/Forms/ModeSelectionForm.cs index a39a4bd..d23fdbd 100644 --- a/UnionPatcher.Gui/Forms/ModeSelectionForm.cs +++ b/UnionPatcher.Gui/Forms/ModeSelectionForm.cs @@ -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 @@ -23,10 +24,27 @@ public class ModeSelectionForm : Form { 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;