public static Action <InventoryGrid, ItemDrop.ItemData, Vector2i, InventoryGrid.Modifier> OnSelected(InventoryGui inventoryGui) { return((InventoryGrid inventoryGrid, ItemDrop.ItemData item, Vector2i pos, InventoryGrid.Modifier mod) => { if (mod == InventoryGrid.Modifier.Move) { return; } var ext = Player.m_localPlayer.ExtendedPlayer(true); var ok = true; ext.SetSelectingRuneItem(item); if (inventoryGui.m_dragItem != null) { var rune = inventoryGui.m_dragItem?.GetRuneData(); if (rune == null) { Player.m_localPlayer.Message(MessageHud.MessageType.Center, "You can't put a non-rune item on this slot."); ok = false; } } if (ok) { inventoryGui.OnSelectedItem(inventoryGrid, item, pos, mod); } ext.SetSelectingRuneItem(null); }); }
private static Action <InventoryGrid, ItemDrop.ItemData, Vector2i, InventoryGrid.Modifier> OnSelected(InventoryGui inventoryGui) { return((InventoryGrid inventoryGrid, ItemDrop.ItemData item, Vector2i pos, InventoryGrid.Modifier mod) => { EquipmentAndQuickSlots.Log($"OnSelected: inventoryGrid={inventoryGrid}, item={item?.m_shared.m_name}, pos={pos}, mod={mod}"); inventoryGui.OnSelectedItem(inventoryGrid, item, pos, mod); }); }
private static Action <InventoryGrid, ItemDrop.ItemData, Vector2i, InventoryGrid.Modifier> OnSelected(InventoryGui inventoryGui) { return((InventoryGrid inventoryGrid, ItemDrop.ItemData item, Vector2i pos, InventoryGrid.Modifier mod) => { if (mod == InventoryGrid.Modifier.Move) { mod = InventoryGrid.Modifier.Select; } inventoryGui.OnSelectedItem(inventoryGrid, item, pos, mod); }); }