public override void HandleItemDrag(string name, ItemBase draggedItem, DragAndDropManager.DragRemoveItem dragDelegate, SegmentEntity targetEntity) { ExtraStorageHoppers hopper = targetEntity as ExtraStorageHoppers; ItemBase itemForSlot = this.GetItemForSlot(hopper, name); bool flag = true; if (itemForSlot != null) { flag = (draggedItem.mnItemID == itemForSlot.mnItemID); } if (hopper.OT && hopper.IsEmpty() && !hopper.ExemplarSet) { hopper.SetExemplar(draggedItem); } if (name == "ItemSlot" + this.SlotCount && flag && hopper.IsNotFull() && hopper.CheckExemplar(draggedItem)) { ItemBase itemBase = ItemManager.CloneItem(draggedItem); int currentStackSize = ItemManager.GetCurrentStackSize(itemBase); if (hopper.RemainingCapacity < currentStackSize) { ItemManager.SetItemCount(itemBase, hopper.RemainingCapacity); } ExtraStorageHopperWindowNew.StoreItems(WorldScript.mLocalPlayer, hopper, itemBase); InventoryPanelScript.mbDirty = true; SurvivalHotBarManager.MarkAsDirty(); SurvivalHotBarManager.MarkContentDirty(); ExtraStorageHopperWindowNew.networkRedraw = true; } }
public static void SetNewExamplar(Player player, ExtraStorageHoppers hopper, ItemBase itemToSet) { hopper.SetExemplar(itemToSet); FloatingCombatTextManager.instance.QueueText(hopper.mnX, hopper.mnY + 1L, hopper.mnZ, 0.75f, "Set The Type to " + ItemManager.GetItemName(itemToSet), Color.blue, 1.5f); if (!WorldScript.mbIsServer) { NetworkManager.instance.SendInterfaceCommand("ExtraStorageHopperWindow", "SetExemplar", null, itemToSet, hopper, 0f); } }