コード例 #1
0
 private void DesktopClicked(object sender, EventArgs e)
 {
     if (IsActive && _dragControl.Slot != null)
     {
         // drop item to the world
         ItemMessageTranslator.DropToWorld();
         EndDrag();
     }
 }
コード例 #2
0
        private void ToolBarSlotClicked(object sender, InventoryWindowCellMouseEventArgs e)
        {
            if (_dragControl.Slot == null)
            {
                return;
            }

            PlayerManager.PlayerCharacter.Toolbar[e.Cell.InventoryPosition.Y] = _dragControl.Slot.Item.BluePrintId;
            _toolBar.SetSlot(e.Cell.InventoryPosition.Y, new ContainedSlot
            {
                Item         = _dragControl.Slot.Item,
                GridPosition = e.Cell.InventoryPosition
            });

            ItemMessageTranslator.SetToolBar(e.Cell.InventoryPosition.Y, _dragControl.Slot.Item.StaticId);

            _sourceContainer.PutItem(_dragControl.Slot.Item, _dragControl.Slot.GridPosition,
                                     _dragControl.Slot.ItemsCount);

            _guiManager.Screen.Desktop.Children.Remove(_dragControl);
            _dragControl.Slot = null;
            _sourceContainer  = null;
        }