public static void Hide() { InputManager.enabled = true; PlayerController.LockCursor(true); if (Instance != null) { Instance.gameObject.SetActive(false); } if (InventorySystem.grabItem.id != null) { InventorySystem.DropGrabItem(); } // clear crafting foreach (int i in indexList) { if (InventorySystem.items[i].id != null) { NBTObject obj = NBTGeneratorManager.GetObjectGenerator(InventorySystem.items[i].id); InventorySystem.Increment(obj, (byte)InventorySystem.items[i].damage, InventorySystem.items[i].count); InventorySystem.items[i].id = null; InventorySystem.items[i].damage = 0; InventorySystem.items[i].count = 0; } } InventorySystem.items[resultIndex].id = null; InventorySystem.items[resultIndex].damage = 0; InventorySystem.items[resultIndex].count = 0; ItemSelectPanel.instance.RefreshUI(); }
protected virtual void OnLeftMouseClick() { if (highlightIndex == -1) { if (!inBG && InventorySystem.grabItem.id != null) { InventorySystem.DropGrabItem(); RefreshGrabItem(); RefreshUI(); ItemSelectPanel.instance.RefreshUI(); } } if (highlightIndex >= 0 && highlightIndex < 36) { if (InventorySystem.grabItem.id != null && InventorySystem.items[highlightIndex].id != null && InventorySystem.grabItem.id == InventorySystem.items[highlightIndex].id && InventorySystem.grabItem.damage == InventorySystem.items[highlightIndex].damage) { InventorySystem.PutItems(highlightIndex); } else { InventorySystem.MouseGrabItem(highlightIndex); } RefreshGrabItem(); RefreshUI(); ItemSelectPanel.instance.RefreshUI(); } }
public static void Hide() { InputManager.enabled = true; PlayerController.LockCursor(true); if (Instance != null) { Instance.gameObject.SetActive(false); } if (InventorySystem.grabItem.id != null) { InventorySystem.DropGrabItem(); } }
void OnRightMouseClick() { if (highlightIndex == -1) { if (InventorySystem.grabItem.id != null) { InventorySystem.DropGrabItem(); RefreshGrabItem(); RefreshUI(); ItemSelectPanel.instance.RefreshUI(); } } else if (highlightIndex == 40) { if (InventorySystem.grabItem.id == null) { InventorySystem.MouseGrabItem(highlightIndex); RefreshGrabItem(); RefreshUI(); ItemSelectPanel.instance.RefreshUI(); } } else { if (InventorySystem.grabItem.id != null) { if (InventorySystem.items[highlightIndex].id != null) { InventorySystem.MouseGrabItem(highlightIndex); } else { InventorySystem.PutOneItem(highlightIndex); } RefreshGrabItem(); RefreshUI(); ItemSelectPanel.instance.RefreshUI(); } else { if (InventorySystem.items[highlightIndex].id != null) { InventorySystem.SplitHalf(highlightIndex); RefreshGrabItem(); RefreshUI(); ItemSelectPanel.instance.RefreshUI(); } } } }
void OnLeftMouseClick() { if (highlightIndex == -1) { if (InventorySystem.grabItem.id != null) { InventorySystem.DropGrabItem(); RefreshGrabItem(); RefreshUI(); ItemSelectPanel.instance.RefreshUI(); } } else if (highlightIndex == 40) { if (InventorySystem.grabItem.id == null) { InventorySystem.CraftItems(); RefreshGrabItem(); RefreshUI(); ItemSelectPanel.instance.RefreshUI(); } } else { if (InventorySystem.grabItem.id != null && InventorySystem.items[highlightIndex].id != null && InventorySystem.grabItem.id == InventorySystem.items[highlightIndex].id) { InventorySystem.PutItems(highlightIndex); } else { InventorySystem.MouseGrabItem(highlightIndex); } RefreshGrabItem(); RefreshUI(); ItemSelectPanel.instance.RefreshUI(); } }