Patch_GameScript_ShiftClickStorage.cs 736 B

123456789101112131415161718192021222324252627282930
  1. using GadgetCore.API;
  2. using HarmonyLib;
  3. using System.Collections;
  4. using System.Reflection;
  5. using UnityEngine;
  6. namespace StorageExpansion.Patches
  7. {
  8. [HarmonyPatch(typeof(GameScript))]
  9. [HarmonyPatch("ShiftClickStorage")]
  10. [HarmonyGadget("StorageExpansion")]
  11. public static class Patch_GameScript_ShiftClickStorage
  12. {
  13. [HarmonyPrefix]
  14. public static bool Prefix(GameScript __instance, ref bool ___shiftclicking, int ___curStoragePage, ref IEnumerator __result)
  15. {
  16. __instance.StartCoroutine(__instance.RefreshStoragePage(___curStoragePage));
  17. ___shiftclicking = false;
  18. __result = FakeRoutine();
  19. return false;
  20. }
  21. public static IEnumerator FakeRoutine()
  22. {
  23. yield break;
  24. }
  25. }
  26. }