Fix windows mods being detected as linux, add small comment

mac
Miepee 3 years ago
parent ff34c23a88
commit c6220dc568

@ -80,6 +80,7 @@ public static class HelperMethods
public static void SaveAndroidIcon(string iconPath, int dimensions, string filePath) public static void SaveAndroidIcon(string iconPath, int dimensions, string filePath)
{ {
Image picture = Image.Load(iconPath); Image picture = Image.Load(iconPath);
// Most am2r cover is pixelart, hence why NN is used. Hermite would probably be a decent alternative too though.
picture.Mutate(x => x.Resize(dimensions, dimensions, KnownResamplers.NearestNeighbor)); picture.Mutate(x => x.Resize(dimensions, dimensions, KnownResamplers.NearestNeighbor));
picture.SaveAsPng(filePath); picture.SaveAsPng(filePath);
} }

@ -18,7 +18,7 @@ public abstract class RawMods : IMods
{ {
ZipArchive archive = ZipFile.OpenRead(inputRawZipPath); ZipArchive archive = ZipFile.OpenRead(inputRawZipPath);
if (archive.Entries.Any(f => f.FullName == "AM2R.exe") && archive.Entries.Any(f => f.FullName == "data.win")) if (archive.Entries.Any(f => f.FullName == "AM2R.exe") && archive.Entries.Any(f => f.FullName == "data.win"))
return ModOS.Linux; return ModOS.Windows;
if (archive.Entries.Any(f => f.FullName == "runner") && archive.Entries.Any(f => f.FullName == "assets/game.unx")) if (archive.Entries.Any(f => f.FullName == "runner") && archive.Entries.Any(f => f.FullName == "assets/game.unx"))
return ModOS.Linux; return ModOS.Linux;
@ -183,8 +183,6 @@ public abstract class RawMods : IMods
HelperMethods.SaveAndroidIcon(origPath, 144, resPath + "/drawable-xxhdpi-v4/icon.png"); HelperMethods.SaveAndroidIcon(origPath, 144, resPath + "/drawable-xxhdpi-v4/icon.png");
HelperMethods.SaveAndroidIcon(origPath, 192, resPath + "/drawable-xxxhdpi-v4/icon.png"); HelperMethods.SaveAndroidIcon(origPath, 192, resPath + "/drawable-xxxhdpi-v4/icon.png");
// TODO: Hermite probably best as image upscaler, but we'll see
// On certain occasions, we need to modify the manifest file. // On certain occasions, we need to modify the manifest file.
if (useCustomSaveDirectory || usesInternet) if (useCustomSaveDirectory || usesInternet)
{ {

Loading…
Cancel
Save