diff --git a/StoragePlayer.cs b/StoragePlayer.cs index fa04357d..8ce0fd68 100644 --- a/StoragePlayer.cs +++ b/StoragePlayer.cs @@ -328,6 +328,47 @@ public override bool ShiftClickSlot(Item[] inventory, int context, int slot) return true; } + public override bool HoverSlot(Item[] inventory, int context, int slot) + { + if (context != ItemSlot.Context.InventoryItem && context != ItemSlot.Context.InventoryCoin && context != ItemSlot.Context.InventoryAmmo) + return false; + if (storageAccess.X < 0 || storageAccess.Y < 0) + return false; + Item item = inventory[slot]; + if (item.favorited || item.IsAir) + return false; + + if (Player.inventory[slot] == inventory[slot]) + { + bool pass = false; + using (SecuritySystem.CreateAccessContext()) + { + foreach (TEAbstractStorageUnit storageUnit in GetStorageHeart().GetStorageUnits()) + { + if (!storageUnit.IsFull || storageUnit.HasSpaceInStackFor(item)) + { + pass = true; + } + } + } + + if (pass == false) + return false; + } + else if (Player.inventory[slot] != inventory[slot]) + { + if (!Player.CanAcceptItemIntoInventory(item)) + { + return false; + } + } + + if (ItemSlot.ShiftInUse) + Main.cursorOverride = 9; + + return false; + } + public TEStorageComponent GetStorageComponent() { if (storageAccess.X < 0 || storageAccess.Y < 0) return null;