-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A proper way to unlock recipes and items
- Loading branch information
Showing
3 changed files
with
19 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# Place Foundry dependencies here | ||
|
||
* `0Harmony.dll` (unstripped) | ||
* `Main.dll` (publicized) | ||
* `UnityEngine.CoreModule.dll` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters