Esempio n. 1
0
 private void SelectCraftable()
 {
     if (_craftingSelectionPanel.ContentSelectable())
     {
         Vector2 mouse    = _craftingSelectionPanel.GetLocalMousePosition();
         int     slotSize = _craftingSelectionPanel.GetContentWidth() / 5;
         mouse.X /= slotSize;
         mouse.Y /= slotSize;
         int craftIndex = (int)mouse.X + ((int)mouse.Y * 5);
         if (craftIndex >= 0 && craftIndex < _craftableIDs.Count)
         {
             _selectedCraftable = craftIndex;
         }
         else
         {
             _selectedCraftable = -1;
         }
     }
 }