diff --git a/Dependencies/Foundry/README.md b/Dependencies/Foundry/README.md index e5c123f..58dde90 100644 --- a/Dependencies/Foundry/README.md +++ b/Dependencies/Foundry/README.md @@ -1,4 +1,5 @@ # Place Foundry dependencies here +* `0Harmony.dll` (unstripped) * `Main.dll` (publicized) * `UnityEngine.CoreModule.dll` diff --git a/ScienceUnlock/Main.cs b/ScienceUnlock/Main.cs index a75ef55..d46a977 100644 --- a/ScienceUnlock/Main.cs +++ b/ScienceUnlock/Main.cs @@ -1,16 +1,24 @@ -using System.Reflection; +using HarmonyLib; namespace ScienceUnlock { - internal static class Main + [HarmonyPatch(typeof(ItemTemplate), nameof(ItemTemplate.onLoad))] + internal static class ItemTemplate_OnLoad { - [OnGameAssemblyLoad] - public static void OnGameAssemblyLoad(Assembly assembly) + static void Postfix(ItemTemplate __instance, bool isCalledFromEditor) { - if (!BuildInfo.isDemo) - return; + __instance.includeInBuild = true; + __instance.includeInDemo = true; + } + } - BuildInfo.isDemo = false; + [HarmonyPatch(typeof(ResearchTemplate), nameof(ResearchTemplate.onLoad))] + internal static class ResearchTemplate_OnLoad + { + static void Postfix(ResearchTemplate __instance) + { + __instance.includeInBuild = true; + __instance.includeInDemo = true; } } } diff --git a/ScienceUnlock/ScienceUnlock.csproj b/ScienceUnlock/ScienceUnlock.csproj index 799a7eb..9e27c38 100644 --- a/ScienceUnlock/ScienceUnlock.csproj +++ b/ScienceUnlock/ScienceUnlock.csproj @@ -6,6 +6,9 @@ + + ../Dependencies/Foundry/0Harmony.dll + ../Dependencies/Foundry/Main.dll