Browse Source

[StorageExpansion] [2.0.3.8] bug fixes

Zariteis 4 years ago
parent
commit
94c70ed27b

+ 1 - 1
StorageExpansion/Patches/Patch_GameScript_InitializeStorage.cs

@@ -146,7 +146,7 @@ namespace StorageExpansion.Patches
       }
       }
       bool isEnabled = false;
       bool isEnabled = false;
       foreach (var gadget in GadgetCore.API.Gadgets.ListAllEnabledGadgets())
       foreach (var gadget in GadgetCore.API.Gadgets.ListAllEnabledGadgets())
-        if (gadget.Info?.ModName == "QuickStack")
+        if (gadget.Info?.ModName == "Quick Stack")
         {
         {
           isEnabled = true;
           isEnabled = true;
           break;
           break;

+ 30 - 0
StorageExpansion/Patches/Patch_GameScript_ShiftClickStorage.cs

@@ -0,0 +1,30 @@
+using GadgetCore.API;
+using HarmonyLib;
+using System.Collections;
+using System.Reflection;
+using UnityEngine;
+
+namespace StorageExpansion.Patches
+{
+
+  [HarmonyPatch(typeof(GameScript))]
+  [HarmonyPatch("ShiftClickStorage")]
+  [HarmonyGadget("StorageExpansion")]
+  public static class Patch_GameScript_ShiftClickStorage
+  {
+
+    [HarmonyPrefix]
+    public static bool Prefix(GameScript __instance, ref bool ___shiftclicking, int ___curStoragePage, ref IEnumerator __result)
+    {
+      __instance.StartCoroutine(__instance.RefreshStoragePage(___curStoragePage));
+      ___shiftclicking = false;
+      __result = FakeRoutine();
+      return false;
+    }
+
+    public static IEnumerator FakeRoutine()
+    {
+      yield break;
+    }
+  }
+}