36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
using System.Collections.Generic;
|
|
using HarmonyLib;
|
|
|
|
namespace UnlockAll.Patches;
|
|
|
|
public static class InventoryPatches
|
|
{
|
|
public static CraftingMode ActiveCraftingMode;
|
|
|
|
[HarmonyPatch(typeof(InventoryUI), "updateCraftingRecipes")]
|
|
[HarmonyPrefix]
|
|
public static bool UpdateCraftingRecipesPrefix()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
[HarmonyPatch(typeof(InventoryUI), "updateCraftingRecipes")]
|
|
[HarmonyPostfix]
|
|
public static void UpdateCraftingRecipesPostfix(InventoryUI __instance, ref int __result)
|
|
{
|
|
List<RecipeConfig> allRecipes = ConfigManager.GetAllByType<RecipeConfig>();
|
|
List<RecipeConfig> validRecipes = new();
|
|
|
|
List<InventoryItemRow> _inventoryRows = Traverse.Create(__instance).Field("_inventoryRows").GetValue<List<InventoryItemRow>>();
|
|
|
|
for (int index = 0; index < allRecipes.Count; ++index)
|
|
{
|
|
RecipeConfig recipe = allRecipes[index];
|
|
|
|
if (recipe != null)
|
|
{
|
|
CraftingMode recipeMode
|
|
}
|
|
}
|
|
}
|
|
} |