Actually make windows optional

pull/9/head
Miepee 4 years ago
parent 71809dcc0a
commit 08bf9f9876

@ -39,6 +39,7 @@ public partial class ModPacker : Form
var dialog = new SelectFolderDialog();
// TODO: .config on linux
dialog.Directory = Environment.GetEnvironmentVariable("LocalAppData");
while (!wasSuccessful)
{
@ -94,7 +95,6 @@ public partial class ModPacker : Form
windowsLabel.Visible = false;
windowsPath = "";
}
UpdateCreateButton();
}
@ -203,8 +203,11 @@ public partial class ModPacker : Form
createLabel.Text = "Packaging mod(s)... This could take a while!";
string output;
bool successful;
string errorCode;
// TODO: make windows optional
if (windowsCheckBox.Checked.Value)
{
using (var saveFile = new SaveFileDialog { Title = "Save Windows mod profile", Filters = { zipFileFilter } })
{
if (saveFile.ShowDialog(this) == DialogResult.Ok)
@ -216,13 +219,13 @@ public partial class ModPacker : Form
}
}
LoadProfileParameters(ProfileOperatingSystems.Windows);
(bool successful, string errorcode) = Core.CreateModPack(profile, windowsPath,originalPath, apkPath, output);
(successful, errorCode) = Core.CreateModPack(profile, windowsPath, originalPath, apkPath, output);
if (!successful)
{
MessageBox.Show(errorcode, "Error", MessageBoxButtons.OK, MessageBoxType.Error);
MessageBox.Show(errorCode, "Error", MessageBoxButtons.OK, MessageBoxType.Error);
AbortPatch();
}
}
if (linuxCheckBox.Checked.Value)
{
@ -237,10 +240,10 @@ public partial class ModPacker : Form
}
}
LoadProfileParameters(ProfileOperatingSystems.Linux);
(successful, errorcode) = Core.CreateModPack(profile, linuxPath, originalPath, apkPath, output);
(successful, errorCode) = Core.CreateModPack(profile, linuxPath, originalPath, apkPath, output);
if (!successful)
{
MessageBox.Show(errorcode, "Error", MessageBoxButtons.OK, MessageBoxType.Error);
MessageBox.Show(errorCode, "Error", MessageBoxButtons.OK, MessageBoxType.Error);
AbortPatch();
}
}

@ -61,17 +61,17 @@ public static class Core
string newMD5 = CalculateMD5(tempOriginalPath + "/data.win");
if (newMD5 != originalMD5)
{
return (false, "1.1 data.win does not meet MD5 checksum! Mod packaging aborted.\n1.1 MD5: " + originalMD5 + "\nYour MD5: " + newMD5);
}
}
catch (FileNotFoundException)
{
return (false, "data.win not found! Are you sure you selected AM2R 1.1? Mod packaging aborted.");
}
switch (profile.OperatingSystem)
{
// Create AM2R.exe and data.win patches
if (profile.OperatingSystem == "Windows")
case "Windows":
{
if (!File.Exists(tempModPath + "/AM2R.exe"))
{ //TODO: put this onto the outer method
@ -104,13 +104,14 @@ public static class Core
CreatePatch(tempOriginalPath + "/data.win", tempModPath + "/data.win", tempProfilePath + "/data.xdelta");
CreatePatch(tempOriginalPath + "/AM2R.exe", tempModPath + "/AM2R.exe", tempProfilePath + "/AM2R.xdelta");
}
break;
}
else if (profile.OperatingSystem == "Linux")
case "Linux":
{
string runnerName = File.Exists(tempModPath + "/" + "AM2R") ? "AM2R" : "runner";
if (!File.Exists(tempModPath + "/" + runnerName))
{//TODO: put this onto the outer method
{ //TODO: put this onto the outer method
/*
var result = MessageBox.Show("Modded Linux game not found, make sure it's not placed in any subfolders.\nCreated profile will likely not be installable, are you sure you want to continue?", "WARNING", MessageBoxButtons.YesNo, MessageBoxType.Warning);
if (result != DialogResult.Yes)
@ -133,8 +134,9 @@ public static class Core
CreatePatch(tempOriginalPath + "/data.win", tempModPath + "/assets/game.unx", tempProfilePath + "/game.xdelta");
CreatePatch(tempOriginalPath + "/AM2R.exe", tempModPath + "/" + runnerName, tempProfilePath + "/AM2R.xdelta");
break;
}
else if (profile.OperatingSystem == "Mac")
case "Mac":
{
if (!File.Exists(tempModPath + "/AM2R.app/Contents/MacOS/Mac_Runner"))
{
@ -155,6 +157,8 @@ public static class Core
// Copy plist over for custom title name
File.Copy(tempModPath + "/AM2R.app/Contents/Info.plist", tempProfilePath + "/Info.plist");
break;
}
}
// Create game.droid patch and wrapper if Android is supported

@ -1,5 +1,4 @@
using System;
using System.Xml.Serialization;
using System.Xml.Serialization;
namespace AM2RModPackerLib.XML;

@ -1,6 +1,4 @@
using System;
using System.IO;
using System.Text;
using System.Text;
namespace AM2RModPackerLib.XML;

Loading…
Cancel
Save