diff --git a/README.md b/README.md index aac343e8..2dcae25d 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ pkNX also provides some utility to extract from supported container types, e.g. pkNX is a Windows Forms application which requires [.NET Framework v4.6](https://www.microsoft.com/en-us/download/details.aspx?id=48137). -The executable can be built with any compiler that supports C# 8. +The executable can be built with any compiler that supports C# 9. ## Dependencies diff --git a/pkNX.Containers/pkNX.Containers.csproj b/pkNX.Containers/pkNX.Containers.csproj index fefc8ef3..04851892 100644 --- a/pkNX.Containers/pkNX.Containers.csproj +++ b/pkNX.Containers/pkNX.Containers.csproj @@ -1,7 +1,7 @@ - + - netstandard2.0;net46 + netstandard2.0;net461 Packing & Unpacking 9 enable diff --git a/pkNX.Game/pkNX.Game.csproj b/pkNX.Game/pkNX.Game.csproj index 53318e09..c02ae8ea 100644 --- a/pkNX.Game/pkNX.Game.csproj +++ b/pkNX.Game/pkNX.Game.csproj @@ -1,7 +1,7 @@ - + - netstandard2.0;net46 + netstandard2.0;net461 Game Data Manager 9 diff --git a/pkNX.Randomization/pkNX.Randomization.csproj b/pkNX.Randomization/pkNX.Randomization.csproj index 2be3af3d..d28f5399 100644 --- a/pkNX.Randomization/pkNX.Randomization.csproj +++ b/pkNX.Randomization/pkNX.Randomization.csproj @@ -1,7 +1,7 @@  - netstandard2.0;net46 + netstandard2.0;net461 Randomizer Utility 9 enable diff --git a/pkNX.Sprites/pkNX.Sprites.csproj b/pkNX.Sprites/pkNX.Sprites.csproj index ef61ff68..37cec757 100644 --- a/pkNX.Sprites/pkNX.Sprites.csproj +++ b/pkNX.Sprites/pkNX.Sprites.csproj @@ -1,9 +1,10 @@ - + - net5.0;net46 + net5.0;net461 9 enable + true @@ -11,6 +12,7 @@ + True True @@ -27,7 +29,6 @@ - diff --git a/pkNX.Structures/Encounter/Gen8/FlatStatic/EncounterStatic8.cs b/pkNX.Structures/Encounter/Gen8/FlatStatic/EncounterStatic8.cs index 83516191..d33d1fe3 100644 --- a/pkNX.Structures/Encounter/Gen8/FlatStatic/EncounterStatic8.cs +++ b/pkNX.Structures/Encounter/Gen8/FlatStatic/EncounterStatic8.cs @@ -73,7 +73,7 @@ public int[] Moves public enum Scenario { None, - Legendary_Pokémon, + Legendary_Pokemon, _2, _3, Eternatus, diff --git a/pkNX.Structures/pkNX.Structures.csproj b/pkNX.Structures/pkNX.Structures.csproj index 7fb01a84..29b803a6 100644 --- a/pkNX.Structures/pkNX.Structures.csproj +++ b/pkNX.Structures/pkNX.Structures.csproj @@ -1,7 +1,7 @@  - netstandard2.0;net46 + netstandard2.0;net461 Data Structures 9 diff --git a/pkNX.WinForms/Dumping/FlatBufferConverter.cs b/pkNX.WinForms/Dumping/FlatBufferConverter.cs index 03f18793..ca81f988 100644 --- a/pkNX.WinForms/Dumping/FlatBufferConverter.cs +++ b/pkNX.WinForms/Dumping/FlatBufferConverter.cs @@ -1,4 +1,5 @@ -using System.Diagnostics; +using System; +using System.Diagnostics; using System.IO; using System.Windows.Forms; using Newtonsoft.Json; @@ -119,9 +120,20 @@ private static void GenerateBinFrom(T obj) private static void RunFlatC(string args) { - var fcp = Path.Combine(FlatPath, "flatc.exe"); - if (!File.Exists(fcp)) - File.WriteAllBytes(fcp, Resources.flatc); + String fcp = ""; + // If there's a flatc on the path, prefer it. + foreach (var path in Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator)) + { + var fullPath = Path.Combine(path, "flatc"); + if (File.Exists(fullPath)) + fcp = fullPath; + } + if (string.IsNullOrEmpty(fcp)) + { + fcp = Path.Combine(FlatPath, "flatc.exe"); + if (!File.Exists(fcp)) + File.WriteAllBytes(fcp, Resources.flatc); + } using var process = new Process { @@ -130,8 +142,8 @@ private static void RunFlatC(string args) WorkingDirectory = FlatPath, WindowStyle = ProcessWindowStyle.Hidden, CreateNoWindow = true, - FileName = "cmd.exe", - Arguments = $"/C flatc {args} & exit", + FileName = fcp, + Arguments = args, } }; process.Start(); diff --git a/pkNX.WinForms/Properties/Resources.resx b/pkNX.WinForms/Properties/Resources.resx index 8ef06502..58c91b39 100644 --- a/pkNX.WinForms/Properties/Resources.resx +++ b/pkNX.WinForms/Properties/Resources.resx @@ -1,4 +1,4 @@ - +