From 908e1010cdfa0793be7514c109e3b33278adb220 Mon Sep 17 00:00:00 2001 From: KaBooMa Date: Sun, 27 Apr 2025 19:22:49 -0500 Subject: [PATCH 1/4] fix: Updated .csprojs to use new build configs --- S1API/S1API.csproj | 8 ++++---- S1APILoader/S1APILoader.csproj | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/S1API/S1API.csproj b/S1API/S1API.csproj index fbc93d6b..fc6e8191 100644 --- a/S1API/S1API.csproj +++ b/S1API/S1API.csproj @@ -96,13 +96,13 @@ - - + + - - + + diff --git a/S1APILoader/S1APILoader.csproj b/S1APILoader/S1APILoader.csproj index b1f35e40..b664e6a4 100644 --- a/S1APILoader/S1APILoader.csproj +++ b/S1APILoader/S1APILoader.csproj @@ -20,13 +20,13 @@ - + - + - + - + From 696f482fb47ca2ebebc1e57f4a6a597cf8df423d Mon Sep 17 00:00:00 2001 From: KaBooMa Date: Sun, 27 Apr 2025 19:23:07 -0500 Subject: [PATCH 2/4] fix: Switched to renames to satisfy TSMM --- S1APILoader/S1APILoader.cs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/S1APILoader/S1APILoader.cs b/S1APILoader/S1APILoader.cs index 4c53f247..13daaded 100644 --- a/S1APILoader/S1APILoader.cs +++ b/S1APILoader/S1APILoader.cs @@ -17,20 +17,22 @@ public override void OnPreModsLoaded() if (pluginsFolder == null) throw new Exception("Failed to identify plugins folder."); - string buildsFolder = Path.Combine(pluginsFolder, BuildFolderName); + string modsFolder = Path.Combine(pluginsFolder, "../Mods"); string activeBuild = MelonUtils.IsGameIl2Cpp() ? "Il2Cpp" : "Mono"; + string inactiveBuild = !MelonUtils.IsGameIl2Cpp() ? "Il2Cpp" : "Mono"; + MelonLogger.Msg($"Loading S1API for {activeBuild}..."); - string s1APIBuildFile = Path.Combine(buildsFolder, $"S1API.{activeBuild}.dll"); + string s1APIActiveBuildFile = Path.Combine(modsFolder, $"S1API.{activeBuild}.dll"); + string s1APIInactiveBuildFile = Path.Combine(modsFolder, $"S1API.{inactiveBuild}.dll"); - // FIX: https://github.com/KaBooMa/S1API/issues/30 - // Manual assembly loading versus file manipulation. - // Thunderstore doesn't pick it up if we do file manipulation. - Assembly assembly = Assembly.LoadFile(s1APIBuildFile); - MelonAssembly melonAssembly = MelonAssembly.LoadMelonAssembly(s1APIBuildFile, assembly); - foreach (MelonBase melon in melonAssembly.LoadedMelons) - melon.Register(); + string disabledActiveBuildFile = $"{s1APIActiveBuildFile}.disabled"; + if (File.Exists(disabledActiveBuildFile)) + File.Move($"{s1APIActiveBuildFile}.disabled", s1APIActiveBuildFile); + + if (File.Exists(s1APIInactiveBuildFile)) + File.Move(s1APIInactiveBuildFile, $"{s1APIInactiveBuildFile}.disabled"); MelonLogger.Msg($"Successfully loaded S1API for {activeBuild}!"); } From 43ec5c5f5ef8546df7abad2aced72b9c15dfc1ed Mon Sep 17 00:00:00 2001 From: KaBooMa Date: Sun, 27 Apr 2025 19:30:57 -0500 Subject: [PATCH 3/4] fix: Updated deployment to Mods/ folder --- .github/workflows/deploy-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-build.yml b/.github/workflows/deploy-build.yml index d5b1e4d5..7655e5e4 100644 --- a/.github/workflows/deploy-build.yml +++ b/.github/workflows/deploy-build.yml @@ -72,10 +72,10 @@ jobs: - name: Build artifact zip for Thunderstore run: | mkdir -p ./artifacts/thunderstore/Plugins/S1API - cp ./S1APILoader/bin/MonoMelon/netstandard2.1/S1APILoader.dll ./artifacts/thunderstore/Plugins/S1APILoader.MelonLoader.dll + cp ./S1APILoader/bin/MonoMelon/netstandard2.1/S1APILoader.dll ./artifacts/thunderstore/Plugins/S1APILoader.dll # cp ./S1APILoader/bin/MonoBepInEx/netstandard2.1/S1APILoader.dll ./artifacts/thunderstore/Plugins/S1APILoader.BepInEx.dll - cp ./S1API/bin/Il2CppMelon/net6.0/S1API.dll ./artifacts/thunderstore/Plugins/S1API/S1API.Il2Cpp.MelonLoader.dll - cp ./S1API/bin/MonoMelon/netstandard2.1/S1API.dll ./artifacts/thunderstore/Plugins/S1API/S1API.Mono.MelonLoader.dll + cp ./S1API/bin/Il2CppMelon/net6.0/S1API.dll ./artifacts/thunderstore/Mods/S1API.Il2Cpp.MelonLoader.dll + cp ./S1API/bin/MonoMelon/netstandard2.1/S1API.dll ./artifacts/thunderstore/Mods/S1API.Mono.MelonLoader.dll # cp ./S1API/bin/Il2CppMelon/net6.0/S1API.dll ./artifacts/thunderstore/Plugins/S1API/S1API.Il2Cpp.BepInEx.dll # cp ./S1API/bin/MonoMelon/netstandard2.1/S1API.dll ./artifacts/thunderstore/Plugins/S1API/S1API.Mono.BepInEx.dll From 282ed8d761fff4d5620045edbaaa45ce0e285bb7 Mon Sep 17 00:00:00 2001 From: KaBooMa Date: Sun, 27 Apr 2025 19:31:10 -0500 Subject: [PATCH 4/4] fix: Added MelonLoader to filename for future BepInEx support --- S1APILoader/S1APILoader.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/S1APILoader/S1APILoader.cs b/S1APILoader/S1APILoader.cs index 13daaded..d52334d7 100644 --- a/S1APILoader/S1APILoader.cs +++ b/S1APILoader/S1APILoader.cs @@ -24,8 +24,8 @@ public override void OnPreModsLoaded() MelonLogger.Msg($"Loading S1API for {activeBuild}..."); - string s1APIActiveBuildFile = Path.Combine(modsFolder, $"S1API.{activeBuild}.dll"); - string s1APIInactiveBuildFile = Path.Combine(modsFolder, $"S1API.{inactiveBuild}.dll"); + string s1APIActiveBuildFile = Path.Combine(modsFolder, $"S1API.{activeBuild}.MelonLoader.dll"); + string s1APIInactiveBuildFile = Path.Combine(modsFolder, $"S1API.{inactiveBuild}.MelonLoader.dll"); string disabledActiveBuildFile = $"{s1APIActiveBuildFile}.disabled"; if (File.Exists(disabledActiveBuildFile))