using HarmonyLib;
using GadgetCore.API;
using UnityEngine;
using System.Collections;
using System.Reflection;
using System.Collections.Generic;

namespace RecipeMenuCore.Patches
{
  [HarmonyPatch(typeof(CraftMenuInfo))]
  [HarmonyPatch("AllowQuickCrafting")]
  [HarmonyGadget("RecipeMenuCore")]
  public static class Patch_CraftMenuInfo_AllowQuickCrafting
  {
    [HarmonyPrefix]
    public static bool Prefix(CraftMenuInfo __instance, ref bool __result)
    {
      if(__instance.GetRegistryName() == "Gadget Core:Crafter Menu")
      {
        __result = Core.pageUniversalCrafterInfoList.Count > 0;
        return false;
      }
      return true;
    }
  }
}
