diff --git a/Directory.Build.props b/Directory.Build.props index 332767cf..abe159c5 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 1.4.2 + 1.4.3 netstandard2.0 11 true diff --git a/SpaceWarpBuildTemplate/swinfo.json b/SpaceWarpBuildTemplate/swinfo.json index d0613137..f5153c21 100644 --- a/SpaceWarpBuildTemplate/swinfo.json +++ b/SpaceWarpBuildTemplate/swinfo.json @@ -6,7 +6,7 @@ "description": "Space-Warp is an API for KSP2 mod developers.", "source": "https://github.com/SpaceWarpDev/SpaceWarp", "version_check": "https://raw.githubusercontent.com/SpaceWarpDev/SpaceWarp/main/SpaceWarpBuildTemplate/swinfo.json", - "version": "1.4.2", + "version": "1.4.3", "dependencies": [ { "id": "UitkForKsp2", @@ -24,7 +24,7 @@ } ], "ksp2_version": { - "min": "0", + "min": "0.1.4.0", "max": "*" } } diff --git a/SpaceWarpPatcher/Patcher.cs b/SpaceWarpPatcher/Patcher.cs index a397cdc8..a8b58f5e 100644 --- a/SpaceWarpPatcher/Patcher.cs +++ b/SpaceWarpPatcher/Patcher.cs @@ -96,7 +96,9 @@ private static (string name, string path) GetNameAndPath(FileInfo jsonFile) var path = '"' + jsonFile.Directory.FullName.Replace("\"","\\\"").Replace("\\","\\\\") + '"'; var obj = JObject.Parse(File.ReadAllText(jsonFile.FullName)); var id = obj["mod_id"].Value(); - var replaced = id.Replace(".", "_").Replace(" ", "_"); + var replaced = id.Replace(".", "_") + .Replace(" ", "_") + .Replace("-", "_"); return (replaced, path); } @@ -134,7 +136,7 @@ private static void GenerateSpaceWarpPathsDLL(bool changed, ManualLogSource true var allSwinfos = new DirectoryInfo(Path.Combine(Paths.BepInExRootPath, "plugins")) .EnumerateFiles("swinfo.json", SearchOption.AllDirectories).Where(x => IsDisabled(x, allDisabled)) - .Select(x => GetNameAndPath(x)); + .Select(GetNameAndPath); // Now we build the dll var dll = "public static class SpaceWarpPaths {\n"; foreach (var swinfo in allSwinfos)