From 32a85889755222f5ffaeba7ea3624fec2ab92527 Mon Sep 17 00:00:00 2001 From: Miepee Date: Sat, 10 Dec 2022 16:13:28 +0100 Subject: [PATCH] Dont unload all user data upon failure --- AM2RModPacker/ModPacker.Designer.cs | 5 +++-- AM2RModPacker/ModPacker.cs | 13 ------------- AM2RModPackerLib/Core.cs | 2 +- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/AM2RModPacker/ModPacker.Designer.cs b/AM2RModPacker/ModPacker.Designer.cs index 23e4854..2c44186 100644 --- a/AM2RModPacker/ModPacker.Designer.cs +++ b/AM2RModPacker/ModPacker.Designer.cs @@ -56,7 +56,7 @@ public partial class ModPacker : Form miscOptionsPanel.AddRow(macButton, macLabel); var loadZipsPanel = new DynamicLayout() { Spacing = new Size(5, 5) }; - loadZipsPanel.AddRow(originalZipButton, null, originalZipLabel); + loadZipsPanel.AddRow(originalZipButton, originalZipLabel); var resultPanel = new DynamicLayout() { Spacing = new Size(5, 5) }; resultPanel.AddRow(createButton); @@ -110,7 +110,8 @@ public partial class ModPacker : Form private CheckBox customSaveCheckBox = new CheckBox() { Text = "Uses custom save directory" }; private Button customSaveButton = new Button() { Text = "Select folder", Enabled = false }; - private TextBox customSaveTextBox = new TextBox(); + // TODO: remove read only and make it correctly respond to user input + private TextBox customSaveTextBox = new TextBox() { ReadOnly = true}; private CheckBox musicCheckBox = new CheckBox() { Text = "Uses custom music" }; private CheckBox yycCheckBox = new CheckBox() { Text = "Uses the YoYo Compiler" }; diff --git a/AM2RModPacker/ModPacker.cs b/AM2RModPacker/ModPacker.cs index 8517ff8..77c7387 100644 --- a/AM2RModPacker/ModPacker.cs +++ b/AM2RModPacker/ModPacker.cs @@ -227,8 +227,6 @@ public partial class ModPacker : Form createLabel.Text = "Packaging mod(s)... This could take a while!"; string output; - bool successful; - string errorCode; if (windowsCheckBox.Checked.Value) { @@ -399,17 +397,6 @@ public partial class ModPacker : Form private void AbortPatch() { - // Unload files - isOriginalLoaded = false; - isWindowsLoaded = false; - isApkLoaded = false; - isLinuxLoaded = false; - originalPath = ""; - windowsPath = ""; - apkPath = ""; - linuxPath = ""; - saveFilePath = null; - // Set labels createLabel.Text = "Mod packaging aborted!"; originalZipLabel.Visible = false; diff --git a/AM2RModPackerLib/Core.cs b/AM2RModPackerLib/Core.cs index 44e5aa9..80f5831 100644 --- a/AM2RModPackerLib/Core.cs +++ b/AM2RModPackerLib/Core.cs @@ -254,7 +254,7 @@ public static class Core const string d3dHash = "86e39e9161c3d930d93822f1563c280d"; const string dataWinHash = "f2b84fe5ba64cb64e284be1066ca08ee"; const string am2rHash = "15253f7a66d6ea3feef004ebbee9b438"; - string tmpPath = Path.GetTempPath() + Path.GetFileNameWithoutExtension(zipPath); + string tmpPath = Path.GetTempPath() + "/" + Path.GetFileNameWithoutExtension(zipPath); // Clean up in case folder exists already if (Directory.Exists(tmpPath))