示例#1
0
        private void OnColDragStart(object sender, ref BaseDragObject dragObject)
        {
            int idx = fColList.SelIndex;

            if (idx >= 0 && idx < fColList.Items.Count)
            {
                Item item = (Item)fColList.Items.GetItem(idx).Data;
                dragObject = new InventoryObject();
                ((InventoryObject)dragObject).InvItem = item;
            }
        }
示例#2
0
        private void OnIngrDragStart(object sender, ref BaseDragObject dragObject)
        {
            int idx = fIngredientsList.SelIndex;

            if (idx >= 0 && idx < fIngredientsList.Items.Count)
            {
                Item item = (Item)((fIngredientsList.Items.GetItem(idx).Data is Item) ? fIngredientsList.Items.GetItem(idx).Data : null);
                dragObject = new InventoryObject();
                ((InventoryObject)dragObject).InvItem = item;
            }
        }
        private void OnPackDragStart(object sender, ref BaseDragObject dragObject)
        {
            int idx = fPackList.SelIndex;

            if (idx >= 0 && idx < fPackList.Items.Count)
            {
                Item item = (Item)fPackList.Items.GetItem(idx).Data;
                if (fIngredientsList.Items.IndexOf(item.Name) < 0)
                {
                    dragObject = new InventoryObject();
                    ((InventoryObject)dragObject).InvItem = item;
                }
            }
        }
示例#4
0
        private void OnPackDragStart(object sender, ref BaseDragObject dragObject)
        {
            int idx = fPackList.SelIndex;

            if (idx >= 0 && idx < fPackList.Items.Count)
            {
                Item item = (Item)fPackList.Items.GetItem(idx).Data;
                if (fIngredients.FindByGUID(item.UID_Renamed) == null)
                {
                    dragObject = new InventoryObject();
                    ((InventoryObject)dragObject).InvItem = item;
                }
                else
                {
                    dragObject = null;
                }
            }
        }