Ejemplo n.º 1
0
        private void DropItem(MyGuiControlListbox listbox, MyGuiControlListboxItem item, int rowIndex, int itemIndex)
        {
            // in god editor and other side listbox, we don't want put this item to this listbox, so we remove it
            if (m_inventoryScreenType == MyGuiScreenInventoryType.GodEditor && listbox == m_otherSideInventoryListBox)
            {
                m_itemsRepository.RemoveItem(item.Key);
            }
            else
            {
                if (listbox.GetItem(rowIndex, itemIndex) != null || listbox.GetRowsCount() <= rowIndex)
                {
                    listbox.AddItem(item);
                }
                else
                {
                    listbox.AddItem(item, rowIndex, itemIndex);
                }

                // if there are no empty row, we try add new row
                if (listbox.GetEmptyRowsCount() == 0)
                {
                    AddFreeRowsIfCan(listbox, 1);
                }                
            }
            StopDragging();
        }