From a9d374b3cdec3050469248b6c68323ab1cc83f7f Mon Sep 17 00:00:00 2001 From: Miepee Date: Sun, 24 Jul 2022 01:52:02 +0200 Subject: [PATCH] Readme improvements and newline fixes --- AM2RPortHelper/Program.cs | 26 ++++++++------------------ README.md | 11 ++++++----- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/AM2RPortHelper/Program.cs b/AM2RPortHelper/Program.cs index 6d23889..b81fe27 100644 --- a/AM2RPortHelper/Program.cs +++ b/AM2RPortHelper/Program.cs @@ -18,7 +18,6 @@ namespace AM2RPortHelper private static void Main(string[] args) { - Console.WriteLine("AM2RPortHelper v" + version); if (args == null || args.Length == 0) @@ -51,8 +50,8 @@ namespace AM2RPortHelper default: Console.WriteLine("Unacceptable input. Aborting..."); return; } Console.WriteLine("Successfully finished!"); - Console.WriteLine("Exiting in 5 seconds..."); - Thread.Sleep(5000); + Console.WriteLine("Exiting in 3 seconds..."); + Thread.Sleep(3000); } private static void PortForLinux(FileInfo modZipPath) @@ -119,8 +118,7 @@ namespace AM2RPortHelper string signer = currentDir + "/utils/uber-apk-signer.jar"; string finalApkBuild = extractDirectory + "/build-aligned-debugSigned.apk"; string apkModPath = currentDir + "/" + Path.GetFileNameWithoutExtension(modZipPath.FullName) + "_ANDROID.apk"; - - + // Check if temp folder exists, delete if yes, extract zip to there if (Directory.Exists(extractDirectory)) Directory.Delete(extractDirectory, true); @@ -139,17 +137,14 @@ namespace AM2RPortHelper Process p = new Process { StartInfo = pStartInfo }; p.Start(); p.WaitForExit(); - - + // Move everything into assets folder Console.WriteLine("Move into assets folder..."); foreach (var file in new DirectoryInfo(unzipDir).GetFiles()) file.MoveTo(apkAssetsDir + "/" + file.Name); foreach (var dir in new DirectoryInfo(unzipDir).GetDirectories()) - { dir.MoveTo(apkAssetsDir + "/" + dir.Name); - } // Delete unnecessary files, rename data.win, move in the new runner Console.WriteLine("Delete unnecessary files and lowercase them..."); @@ -346,12 +341,8 @@ namespace AM2RPortHelper DirectoryInfo dir = new DirectoryInfo(sourceDirName); if (!dir.Exists) - { - throw new DirectoryNotFoundException( - "Source directory does not exist or could not be found: " - + sourceDirName); - } - + throw new DirectoryNotFoundException($"Source directory does not exist or could not be found: {sourceDirName}"); + DirectoryInfo[] dirs = dir.GetDirectories(); // If the destination directory doesn't exist, create it. @@ -364,8 +355,7 @@ namespace AM2RPortHelper string tempPath = Path.Combine(destDirName, file.Name); file.CopyTo(tempPath, true); } - - + if (!copySubDirs) return; @@ -384,4 +374,4 @@ namespace AM2RPortHelper picture.SaveAsPng(filePath); } } -} +} \ No newline at end of file diff --git a/README.md b/README.md index a6f4249..2cb4d4b 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,14 @@ # AM2RPortHelper -A simple tool to make porting Windows builds of AM2R-Mods to other platforms easier. This will *only* work with VM-mods of the Community Updates, neither YYC mods nor mods of the original 1.1 will work. -You need to have at least .NET Core 5 installed in order to run this. +A simple tool to make porting Windows builds of self-created AM2R-Mods to other platforms easier. This will *only* work with VM-mods of the Community Updates, neither YYC mods nor mods of the original 1.1 will work. +You need to have at least .NET Core 6 installed in order to run this. ## How do I use this? -Simply compress your mod as a zip, and then drag-n-drop it into this tool. After that, select if you want to have a port made for Linux or Android. A zip/apk that can be used for the [AM2RModPacker](https://github.com/Miepee/AM2RModpacker-Mac) will then be created into the directory next to the program. +First you need a zip of the self-created mod. If you're using GameMaker: Studio, you can just use the zip it created, if you're using UndertaleModTool you need to zip the files first (your files should not be in a subfolder in the zip!). After that, just drag-n-drop it into this tool and, select if you want to have a port made for Linux, Android or Mac. +It will then create a new zip/apk, which can be used for the [AM2RModPacker](https://github.com/AM2R-Community-Developers/AM2RModpacker-Mac), in the directory next to the program. For the Mac build, you need to use my ModPacker-Mac version which can be found [here](https://github.com/AM2R-Community-Developers/AM2RModpacker-Mac). To create Android builds, you need to have Java installed. -By default, the ports will use stock splash and icon images. Replacing `icon.png`, `splash.png` and `splashAndroid.png` in the utils folder with your own is recommended. +By default, the ports will use stock splash and icon images. *It is recommended to replace `icon.png`, `splash.png` and `splashAndroid.png` in the `utils` folder with your own*. ## Porting notes - Keep Game Maker: Studio documentation in mind, using any functions that only work on one OS or function differently on different OS could lead to the ports having unexpected behaviour or even crashing. @@ -25,4 +26,4 @@ By default, the ports will use stock splash and icon images. Replacing `icon.png * `utils/Contents/Resources/yoyorunner.config` ### Android -- If you use a custom save directory that's *not* inside of `%localappdata%/AM2R`, but instead in `%localappdata%/MyModWithCoolName` you have to change all instances of `com.companyname.AM2RWrapper` to `com.companyname.MyModWithCoolName` in the `AndroidManifest.xml` inside of the `AM2RWrapper.apk`. For this you have to decompile the apk with apktool (`java -jar apktool.jar d AM2RWrapper.apk`), edit the contents, and then rebuild it (`java -jar b apktool.jar b AM2RWrapper`) and sign it (`java -jar uber-apk-signer.jar -a theNewApk.apk`). +- If you use a custom save directory that's *not* inside of `%localappdata%/AM2R`, but instead in `%localappdata%/MyModWithCoolName` you have to change all instances of `com.companyname.AM2RWrapper` to `com.companyname.MyModWithCoolName` in the `AndroidManifest.xml` inside of the `AM2RWrapper.apk`. For this you have to decompile the apk with apktool (`java -jar apktool.jar d AM2RWrapper.apk`), edit the contents, and then rebuild it (`java -jar b apktool.jar b AM2RWrapper`) and sign it (`java -jar uber-apk-signer.jar -a theNewApk.apk`). \ No newline at end of file