mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-09 06:13:36 +08:00
Adopt fix from @starfi5h's NebulaCompabtibilityAssist
This commit is contained in:
@@ -106,7 +106,7 @@ public static class StoragePatch
|
|||||||
comp.IsDusbin = _storageDustbinCheckBox.Checked;
|
comp.IsDusbin = _storageDustbinCheckBox.Checked;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
[HarmonyPatch(typeof(UIStorageWindow), "_OnUpdate")]
|
[HarmonyPatch(typeof(UIStorageWindow), "_OnUpdate")]
|
||||||
private static void UIStorageWindow__OnUpdate_Postfix(UIStorageWindow __instance)
|
private static void UIStorageWindow__OnUpdate_Postfix(UIStorageWindow __instance)
|
||||||
@@ -119,11 +119,21 @@ public static class StoragePatch
|
|||||||
if (storagePool[storageId].id != storageId) return;
|
if (storagePool[storageId].id != storageId) return;
|
||||||
if (storagePool[storageId] is not StorageComponentWithDustbin comp) return;
|
if (storagePool[storageId] is not StorageComponentWithDustbin comp) return;
|
||||||
_storageDustbinCheckBox.Checked = comp.IsDusbin;
|
_storageDustbinCheckBox.Checked = comp.IsDusbin;
|
||||||
if (__instance.transform is RectTransform rectTrans) {
|
if (__instance.transform is RectTransform rectTrans)
|
||||||
|
{
|
||||||
_storageDustbinCheckBox.rectTrans.anchoredPosition3D = new Vector3(50, 58 - rectTrans.sizeDelta.y, 0);
|
_storageDustbinCheckBox.rectTrans.anchoredPosition3D = new Vector3(50, 58 - rectTrans.sizeDelta.y, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Adopt fix from starfi5h's NebulaCompatiblilityAssist */
|
||||||
|
[HarmonyPostfix]
|
||||||
|
[HarmonyPatch(typeof(UIStorageGrid), "OnStorageSizeChanged")]
|
||||||
|
private static void UIStorageGrid_OnStorageSizeChanged_Postfix()
|
||||||
|
{
|
||||||
|
// Due to storage window is empty when open in client, the size will change after receiving data from host
|
||||||
|
_lastStorageId = 0; // Refresh UI to reposition button on client side
|
||||||
|
}
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(StorageComponent), "AddItem",
|
[HarmonyPatch(typeof(StorageComponent), "AddItem",
|
||||||
new[] { typeof(int), typeof(int), typeof(int), typeof(int), typeof(bool) },
|
new[] { typeof(int), typeof(int), typeof(int), typeof(int), typeof(bool) },
|
||||||
|
|||||||
Reference in New Issue
Block a user