Exemplo n.º 1
0
 private void OnRMouseDown()
 {
     if (HUDBackpack.Get().m_IsHovered)
     {
         return;
     }
     if (this.m_CarriedItem)
     {
         this.RotateItem(this.m_CarriedItem);
     }
     else if (this.m_FocusedItem)
     {
         if (!this.m_FocusedItem.m_OnCraftingTable)
         {
             HUDItem.Get().Activate(this.m_FocusedItem);
         }
         else
         {
             CraftingManager.Get().RemoveItem(this.m_FocusedItem);
             if (this.m_FocusedItem.m_Info.IsHeavyObject() || !this.m_FocusedItem.Take())
             {
                 this.DropItem(this.m_FocusedItem);
             }
             this.m_FocusedItem = null;
         }
     }
     else if (this.m_PlayerRotationBlocked)
     {
         this.BlockPlayerRotation(false);
     }
 }
Exemplo n.º 2
0
 private void UpdateCursor()
 {
     if (HUDItem.Get().enabled)
     {
         return;
     }
     if (HUDNewWheel.Get().IsSelected())
     {
         return;
     }
     if (HUDBackpack.Get().m_IsHovered)
     {
         return;
     }
     if (this.m_CarriedItem)
     {
         if (CursorManager.Get().GetCursor() != CursorManager.TYPE.Hand_1)
         {
             CursorManager.Get().SetCursor(CursorManager.TYPE.Hand_1);
         }
     }
     else if (this.m_FocusedItem)
     {
         if (CursorManager.Get().GetCursor() != CursorManager.TYPE.Hand_0)
         {
             CursorManager.Get().SetCursor(CursorManager.TYPE.Hand_0);
         }
     }
     else if (CursorManager.Get().GetCursor() != CursorManager.TYPE.Normal)
     {
         CursorManager.Get().SetCursor(CursorManager.TYPE.Normal);
     }
 }
Exemplo n.º 3
0
 public void OnInventoryChanged()
 {
     this.CalculateCurrentWeight();
     foreach (Item item in this.m_Items)
     {
         item.UpdatePhx();
         item.UpdateScale(false);
     }
     HUDGather.Get().Setup();
     HUDBackpack.Get().SetupPocket(Inventory3DManager.Get().m_ActivePocket);
 }
Exemplo n.º 4
0
 public void SetupPocket(BackpackPocket pocket)
 {
     foreach (Item item in InventoryBackpack.Get().m_Items)
     {
         if (item.m_Info.m_BackpackPocket == pocket)
         {
             item.m_ShownInInventory = true;
         }
     }
     InventoryBackpack.Get().SetupPocket(pocket);
     HUDBackpack.Get().SetupPocket(pocket);
     this.m_ActivePocket = pocket;
 }
Exemplo n.º 5
0
 private void OnLMouseDown()
 {
     if (!this.m_FocusedItem || HUDBackpack.Get().m_IsHovered || this.m_FocusedItem.m_Info.m_CantBeDraggedInInventory || HUDItem.Get().enabled)
     {
         return;
     }
     this.SetCarriedItem(this.m_FocusedItem);
     if (CraftingManager.Get().gameObject.activeSelf&& CraftingManager.Get().ContainsItem(this.m_FocusedItem))
     {
         CraftingManager.Get().RemoveItem(this.m_FocusedItem);
     }
     if (this.m_FocusedItem == Player.Get().GetCurrentItem(Hand.Right))
     {
         Player.Get().SetWantedItem(Hand.Right, null, true);
     }
     else if (this.m_FocusedItem == Player.Get().GetCurrentItem(Hand.Left))
     {
         Player.Get().SetWantedItem(Hand.Left, null, true);
     }
 }
Exemplo n.º 6
0
 private void UpdateFocusedItem()
 {
     this.m_FocusedItem = null;
     if (HUDBackpack.Get().m_IsHovered)
     {
         return;
     }
     if (this.m_CarriedItem)
     {
         this.m_FocusedItem = this.m_CarriedItem;
         return;
     }
     if (HUDQuickAccessBar.Get().AnyButtonSelected())
     {
         return;
     }
     for (int i = 0; i < this.m_BackpackHits.Length; i++)
     {
         Item component = this.m_BackpackHits[i].collider.gameObject.GetComponent <Item>();
         if (this.CanFocusItem(component))
         {
             this.m_FocusedItem = component;
             return;
         }
     }
     if (!this.m_MouseOverBackpack && !this.m_MouseOverCraftTable)
     {
         for (int j = 0; j < this.m_WorldHits.Length; j++)
         {
             Item component2 = this.m_WorldHits[j].collider.gameObject.GetComponent <Item>();
             if (this.CanFocusItem(component2))
             {
                 this.m_FocusedItem = component2;
                 return;
             }
         }
     }
 }