From c65c2a8130c7748a2b8eee03ff716bd9db699d79 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 1 Jun 2013 14:08:03 +0300 Subject: Restore adding items to outfits and drops by clicking only. --- src/gui/outfitwindow.cpp | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'src/gui/outfitwindow.cpp') diff --git a/src/gui/outfitwindow.cpp b/src/gui/outfitwindow.cpp index 04320049c..da5609148 100644 --- a/src/gui/outfitwindow.cpp +++ b/src/gui/outfitwindow.cpp @@ -371,20 +371,6 @@ void OutfitWindow::draw(gcn::Graphics *graphics) } } } -/* - if (mItemMoved) - { - // Draw the item image being dragged by the cursor. - const Image *const image = mItemMoved->getImage(); - if (image) - { - const int tPosX = mCursorPosX - (image->mBounds.w / 2); - const int tPosY = mCursorPosY - (image->mBounds.h / 2); - - g->drawImage(image, tPosX, tPosY); - } - } -*/ BLOCK_END("OutfitWindow::draw") } @@ -451,8 +437,20 @@ void OutfitWindow::mousePressed(gcn::MouseEvent &event) mMoved = false; event.consume(); - if (mItems[mCurrentOutfit][index]) + if (mItems[mCurrentOutfit][index] > 0) + { mItemClicked = true; + } + else + { + Item *const selected = dragDrop.getSelected(); + if (selected) + { + mItems[mCurrentOutfit][index] = selected->getId(); + mItemColors[mCurrentOutfit][index] = selected->getColor(); + dragDrop.deselect(); + } + } Window::mousePressed(event); } @@ -483,6 +481,7 @@ void OutfitWindow::mouseReleased(gcn::MouseEvent &event) mItems[mCurrentOutfit][index] = item->getId(); mItemColors[mCurrentOutfit][index] = item->getColor(); dragDrop.clear(); + dragDrop.deselect(); } } if (mItemClicked) -- cgit v1.2.3-60-g2f50