public void EquipSlotLeftClicked(EquipSlot slot) { MouseSlot mouseSlot = MouseSlot.instance; Item mouseItem = MouseSlot.instance.Item(); if (slotClickHelper.CheckItemType() == false) { return; } if (mouseItem == null && slot.Equipment() == null) //or slot.Equipment() == naked or unarmed? { Debug.Log("BOTH SLOTS EMPTY"); return; } if (mouseItem == null && slot.Equipment() != null) { slotClickHelper.PickUpItemIntoEmptyMouseSlot(mouseSlot, slot); return; } if (mouseItem != null && slot.Equipment() == null) //or slot.Equipment() == naked or unarmed? { slotClickHelper.PlaceItemInEmptySlot(mouseSlot, slot); return; } if (mouseItem != null && slot.Equipment() != null) //or slot.Equipment() == naked or unarmed? { slotClickHelper.SwapItems(mouseSlot, slot); return; } }
public void EquipSlotHoverOver(EquipSlot slot) { if (slot.Equipment() != null) { slot.Equipment().OpenStatWindow("Inventory"); } }
public void EquipSlotRightClicked(EquipSlot slot) { Debug.Log("Equip slot right clicked"); if (slot.Equipment() != null) { slot.EquipmentManager().FastUnequip(slot.Equipment()); } }
//HELPERS public void PickUpItemIntoEmptyMouseSlot(MouseSlot mouseSlot, EquipSlot slot) { Debug.Log("PICK UP ITEM INTO EMPTY MOUSE SLOT"); //or equipment == naked or unarmed? Item previousItem = slot.Equipment(); //save a copy of the slotItem slot.EquipmentManager().Unequip(previousItem.myEquipSlot); //unequip item currently in equip slot mouseSlot.UpdateItem(previousItem); //place previous item in the mouseSlot (as an item)? }
public void SwapItems(MouseSlot mouseSlot, EquipSlot slot) { Item mouseItem = mouseSlot.Item(); //make sure equipment would be going in the correct slot if (!CheckEquipSlot(mouseItem.myEquipSlot, slot)) { return; } Debug.Log("SWAPPING ITEMS"); Item previousItem = slot.Equipment(); //save a copy of the slotItem slot.EquipmentManager().Equip(mouseItem); mouseSlot.UpdateItem(previousItem); //add old item to mouseSlot }