more todo removal/add

pull/9/head
Miepee 4 years ago
parent fcd19f4f61
commit 6e5ebd1aa5

@ -198,6 +198,7 @@ public partial class ModPacker : Form
profile.SaveLocation = "%localappdata%/AM2R"; profile.SaveLocation = "%localappdata%/AM2R";
if (operatingSystem == ProfileOperatingSystems.Linux) if (operatingSystem == ProfileOperatingSystems.Linux)
profile.SaveLocation = profile.SaveLocation.Replace("%localappdata%", "~/.config"); profile.SaveLocation = profile.SaveLocation.Replace("%localappdata%", "~/.config");
//todo: mac
} }
private void AbortPatch() private void AbortPatch()
@ -237,7 +238,6 @@ public partial class ModPacker : Form
createButton.Enabled = false; createButton.Enabled = false;
} }
//todo: make this part of interface
private (bool, string) SelectFile(string title, FileFilter filter) private (bool, string) SelectFile(string title, FileFilter filter)
{ {
using var fileFinder = new OpenFileDialog { Filters = { filter } }; using var fileFinder = new OpenFileDialog { Filters = { filter } };

@ -1,5 +1,6 @@
using System.Diagnostics; using System.Diagnostics;
using System.IO.Compression; using System.IO.Compression;
using System.Security;
using System.Security.Cryptography; using System.Security.Cryptography;
using AM2RModPackerLib.XML; using AM2RModPackerLib.XML;
@ -41,7 +42,7 @@ public static class Core
tempModPath = Directory.CreateDirectory(tempPath + "/mod").FullName; tempModPath = Directory.CreateDirectory(tempPath + "/mod").FullName;
tempProfilePath = Directory.CreateDirectory(tempPath + "/profile").FullName; tempProfilePath = Directory.CreateDirectory(tempPath + "/profile").FullName;
} }
catch (System.Security.SecurityException) catch (SecurityException)
{ {
return (false, "Could not create temp directory! Please run the application with administrator rights."); return (false, "Could not create temp directory! Please run the application with administrator rights.");
} }
@ -57,7 +58,7 @@ public static class Core
try try
{ {
// TODO: dont. do what launcher does // TODO: dont. do what launcher does
string newMD5 = Core.CalculateMD5(tempOriginalPath + "/data.win"); string newMD5 = CalculateMD5(tempOriginalPath + "/data.win");
if (newMD5 != originalMD5) if (newMD5 != originalMD5)
{ {
@ -96,12 +97,12 @@ public static class Core
if (profile.UsesYYC) if (profile.UsesYYC)
{ {
Core.CreatePatch(tempOriginalPath + "/data.win", tempModPath + "/AM2R.exe", tempProfilePath + "/AM2R.xdelta"); CreatePatch(tempOriginalPath + "/data.win", tempModPath + "/AM2R.exe", tempProfilePath + "/AM2R.xdelta");
} }
else else
{ {
Core.CreatePatch(tempOriginalPath + "/data.win", tempModPath + "/data.win", tempProfilePath + "/data.xdelta"); CreatePatch(tempOriginalPath + "/data.win", tempModPath + "/data.win", tempProfilePath + "/data.xdelta");
Core.CreatePatch(tempOriginalPath + "/AM2R.exe", tempModPath + "/AM2R.exe", tempProfilePath + "/AM2R.xdelta"); CreatePatch(tempOriginalPath + "/AM2R.exe", tempModPath + "/AM2R.exe", tempProfilePath + "/AM2R.xdelta");
} }
} }
else if (profile.OperatingSystem == "Linux") else if (profile.OperatingSystem == "Linux")
@ -130,8 +131,8 @@ public static class Core
}*/ }*/
} }
Core.CreatePatch(tempOriginalPath + "/data.win", tempModPath + "/assets/game.unx", tempProfilePath + "/game.xdelta"); CreatePatch(tempOriginalPath + "/data.win", tempModPath + "/assets/game.unx", tempProfilePath + "/game.xdelta");
Core.CreatePatch(tempOriginalPath + "/AM2R.exe", tempModPath + "/" + runnerName, tempProfilePath + "/AM2R.xdelta"); CreatePatch(tempOriginalPath + "/AM2R.exe", tempModPath + "/" + runnerName, tempProfilePath + "/AM2R.xdelta");
} }
// todo: mac // todo: mac
@ -162,7 +163,7 @@ public static class Core
} }
// Create game.droid patch // Create game.droid patch
Core.CreatePatch(tempOriginalPath + "/data.win", tempAndroid + "/assets/game.droid", tempProfilePath + "/droid.xdelta"); CreatePatch(tempOriginalPath + "/data.win", tempAndroid + "/assets/game.droid", tempProfilePath + "/droid.xdelta");
// Delete excess files in APK // Delete excess files in APK
@ -230,7 +231,7 @@ public static class Core
if (profile.UsesCustomMusic) if (profile.UsesCustomMusic)
{ {
// Copy files, excluding the blacklist // Copy files, excluding the blacklist
Core.CopyFilesRecursive(dirInfo, DATAFILES_BLACKLIST, tempProfilePath + "/files_to_copy"); CopyFilesRecursive(dirInfo, DATAFILES_BLACKLIST, tempProfilePath + "/files_to_copy");
} }
else else
{ {
@ -245,7 +246,7 @@ public static class Core
string[] blacklist = musFiles.Concat(DATAFILES_BLACKLIST).ToArray(); string[] blacklist = musFiles.Concat(DATAFILES_BLACKLIST).ToArray();
// Copy files, excluding the blacklist // Copy files, excluding the blacklist
Core.CopyFilesRecursive(dirInfo, blacklist, tempProfilePath + "/files_to_copy"); CopyFilesRecursive(dirInfo, blacklist, tempProfilePath + "/files_to_copy");
} }
// Export profile as XML // Export profile as XML

Loading…
Cancel
Save