Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions StoragePlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down