diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-06-02 22:14:54 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-06-02 22:14:54 +0300 |
commit | 65b614a0d142e229206fbde22a25f4a3b20b1dbc (patch) | |
tree | cb1f90dbbc8aedd3ef2dd7e2269a08b115d9fc7b /src/gui/outfitwindow.cpp | |
parent | bead0d26642bbc0c5e570306c226676c66d18b86 (diff) | |
download | mv-65b614a0d142e229206fbde22a25f4a3b20b1dbc.tar.gz mv-65b614a0d142e229206fbde22a25f4a3b20b1dbc.tar.bz2 mv-65b614a0d142e229206fbde22a25f4a3b20b1dbc.tar.xz mv-65b614a0d142e229206fbde22a25f4a3b20b1dbc.zip |
In drag and drop use ints and images but not pointer to item.
Diffstat (limited to 'src/gui/outfitwindow.cpp')
-rw-r--r-- | src/gui/outfitwindow.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/gui/outfitwindow.cpp b/src/gui/outfitwindow.cpp index b00ab69b9..45ee8465f 100644 --- a/src/gui/outfitwindow.cpp +++ b/src/gui/outfitwindow.cpp @@ -443,11 +443,10 @@ void OutfitWindow::mousePressed(gcn::MouseEvent &event) } else { - Item *const selected = dragDrop.getSelected(); - if (selected) + if (dragDrop.isSelected()) { - mItems[mCurrentOutfit][index] = selected->getId(); - mItemColors[mCurrentOutfit][index] = selected->getColor(); + mItems[mCurrentOutfit][index] = dragDrop.getSelected(); + mItemColors[mCurrentOutfit][index] = dragDrop.getSelectedColor(); dragDrop.deselect(); } } @@ -475,14 +474,10 @@ void OutfitWindow::mouseReleased(gcn::MouseEvent &event) event.consume(); if (!dragDrop.isEmpty()) { - Item *const item = dragDrop.getItem(); - if (item) - { - mItems[mCurrentOutfit][index] = item->getId(); - mItemColors[mCurrentOutfit][index] = item->getColor(); - dragDrop.clear(); - dragDrop.deselect(); - } + mItems[mCurrentOutfit][index] = dragDrop.getItem(); + mItemColors[mCurrentOutfit][index] = dragDrop.getItemColor(); + dragDrop.clear(); + dragDrop.deselect(); } if (mItemClicked) mItemClicked = false; |