Patch_CraftMenuInfo_AllowQuickCrafting.cs 663 B

1234567891011121314151617181920212223242526
  1. using HarmonyLib;
  2. using GadgetCore.API;
  3. using UnityEngine;
  4. using System.Collections;
  5. using System.Reflection;
  6. using System.Collections.Generic;
  7. namespace RecipeMenuCore.Patches
  8. {
  9. [HarmonyPatch(typeof(CraftMenuInfo))]
  10. [HarmonyPatch("AllowQuickCrafting")]
  11. [HarmonyGadget("RecipeMenuCore")]
  12. public static class Patch_CraftMenuInfo_AllowQuickCrafting
  13. {
  14. [HarmonyPrefix]
  15. public static bool Prefix(CraftMenuInfo __instance, ref bool __result)
  16. {
  17. if(__instance.GetRegistryName() == "Gadget Core:Crafter Menu")
  18. {
  19. __result = Core.pageUniversalCrafterInfoList.Count > 0;
  20. return false;
  21. }
  22. return true;
  23. }
  24. }
  25. }