| 12345678910111213141516171819202122232425262728293031323334 |
- using HarmonyLib;
- using GadgetCore.API;
- using UnityEngine;
- using System.Collections;
- namespace RecipeMenuCore.Patches
- {
- [HarmonyPatch(typeof(GameScript))]
- [HarmonyPatch("RecipeUp")]
- [HarmonyGadget("RecipeMenuCore")]
- public static class Patch_GameScript_RecipeUp
- {
- [HarmonyPrefix]
- public static bool Prefix(GameScript __instance, int ___craftType, ref int ___curRecipePage)
- {
- int pages = 1;
- switch (___craftType)
- {
- case 0:
- pages = 6 + Core.pageGearForgeInfoList.Count;
- break;
- case 1:
- pages = 2 + Core.pageAlchemyStationInfoList.Count;
- break;
- case 2:
- pages = 6 + Core.pageUltimateForgeInfoList.Count;
- break;
- }
- ___curRecipePage = (___curRecipePage + 1) % pages;
- __instance.RefreshRecipe();
- return false;
- }
- }
- }
|