Readme improvements and newline fixes

pull/5/head
Miepee 4 years ago
parent dbd9aeb4c9
commit a9d374b3cd

@ -18,7 +18,6 @@ namespace AM2RPortHelper
private static void Main(string[] args) private static void Main(string[] args)
{ {
Console.WriteLine("AM2RPortHelper v" + version); Console.WriteLine("AM2RPortHelper v" + version);
if (args == null || args.Length == 0) if (args == null || args.Length == 0)
@ -51,8 +50,8 @@ namespace AM2RPortHelper
default: Console.WriteLine("Unacceptable input. Aborting..."); return; default: Console.WriteLine("Unacceptable input. Aborting..."); return;
} }
Console.WriteLine("Successfully finished!"); Console.WriteLine("Successfully finished!");
Console.WriteLine("Exiting in 5 seconds..."); Console.WriteLine("Exiting in 3 seconds...");
Thread.Sleep(5000); Thread.Sleep(3000);
} }
private static void PortForLinux(FileInfo modZipPath) private static void PortForLinux(FileInfo modZipPath)
@ -119,8 +118,7 @@ namespace AM2RPortHelper
string signer = currentDir + "/utils/uber-apk-signer.jar"; string signer = currentDir + "/utils/uber-apk-signer.jar";
string finalApkBuild = extractDirectory + "/build-aligned-debugSigned.apk"; string finalApkBuild = extractDirectory + "/build-aligned-debugSigned.apk";
string apkModPath = currentDir + "/" + Path.GetFileNameWithoutExtension(modZipPath.FullName) + "_ANDROID.apk"; string apkModPath = currentDir + "/" + Path.GetFileNameWithoutExtension(modZipPath.FullName) + "_ANDROID.apk";
// Check if temp folder exists, delete if yes, extract zip to there // Check if temp folder exists, delete if yes, extract zip to there
if (Directory.Exists(extractDirectory)) if (Directory.Exists(extractDirectory))
Directory.Delete(extractDirectory, true); Directory.Delete(extractDirectory, true);
@ -139,17 +137,14 @@ namespace AM2RPortHelper
Process p = new Process { StartInfo = pStartInfo }; Process p = new Process { StartInfo = pStartInfo };
p.Start(); p.Start();
p.WaitForExit(); p.WaitForExit();
// Move everything into assets folder // Move everything into assets folder
Console.WriteLine("Move into assets folder..."); Console.WriteLine("Move into assets folder...");
foreach (var file in new DirectoryInfo(unzipDir).GetFiles()) foreach (var file in new DirectoryInfo(unzipDir).GetFiles())
file.MoveTo(apkAssetsDir + "/" + file.Name); file.MoveTo(apkAssetsDir + "/" + file.Name);
foreach (var dir in new DirectoryInfo(unzipDir).GetDirectories()) foreach (var dir in new DirectoryInfo(unzipDir).GetDirectories())
{
dir.MoveTo(apkAssetsDir + "/" + dir.Name); dir.MoveTo(apkAssetsDir + "/" + dir.Name);
}
// Delete unnecessary files, rename data.win, move in the new runner // Delete unnecessary files, rename data.win, move in the new runner
Console.WriteLine("Delete unnecessary files and lowercase them..."); Console.WriteLine("Delete unnecessary files and lowercase them...");
@ -346,12 +341,8 @@ namespace AM2RPortHelper
DirectoryInfo dir = new DirectoryInfo(sourceDirName); DirectoryInfo dir = new DirectoryInfo(sourceDirName);
if (!dir.Exists) 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(); DirectoryInfo[] dirs = dir.GetDirectories();
// If the destination directory doesn't exist, create it. // If the destination directory doesn't exist, create it.
@ -364,8 +355,7 @@ namespace AM2RPortHelper
string tempPath = Path.Combine(destDirName, file.Name); string tempPath = Path.Combine(destDirName, file.Name);
file.CopyTo(tempPath, true); file.CopyTo(tempPath, true);
} }
if (!copySubDirs) if (!copySubDirs)
return; return;
@ -384,4 +374,4 @@ namespace AM2RPortHelper
picture.SaveAsPng(filePath); picture.SaveAsPng(filePath);
} }
} }
} }

@ -1,13 +1,14 @@
# AM2RPortHelper # 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. 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 5 installed in order to run this. You need to have at least .NET Core 6 installed in order to run this.
## How do I use 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. 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 ## 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. - 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` * `utils/Contents/Resources/yoyorunner.config`
### Android ### 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`).
Loading…
Cancel
Save