示例#1
0
    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();
    }
示例#2
0
 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();
     }
 }
示例#3
0
    public static void Hide()
    {
        InputManager.enabled = true;
        PlayerController.LockCursor(true);
        if (Instance != null)
        {
            Instance.gameObject.SetActive(false);
        }

        if (InventorySystem.grabItem.id != null)
        {
            InventorySystem.DropGrabItem();
        }
    }
示例#4
0
 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();
             }
         }
     }
 }
示例#5
0
 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();
     }
 }