From c5e241b276bcbf725309360edc2bdf033f49e98e Mon Sep 17 00:00:00 2001 From: Blue Sans Douze Date: Thu, 14 Jan 2010 21:55:56 +0100 Subject: Auto-store feature Autostore is a feature that allow you a fast store-retreive by pressing emote key and clicking on the object you want to move. All the stack will be moved that way. --- src/gui/storagewindow.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/gui/storagewindow.cpp') diff --git a/src/gui/storagewindow.cpp b/src/gui/storagewindow.cpp index b05c2104..c3b13ef9 100644 --- a/src/gui/storagewindow.cpp +++ b/src/gui/storagewindow.cpp @@ -25,6 +25,7 @@ #include "item.h" #include "localplayer.h" #include "units.h" +#include "keyboardconfig.h" #include "gui/inventorywindow.h" #include "gui/itemamount.h" @@ -174,6 +175,18 @@ void StorageWindow::mouseClicked(gcn::MouseEvent &event) const int my = event.getY() + getY(); viewport->showPopup(mx, my, item, false); } + if (event.getButton() == gcn::MouseEvent::LEFT) + { + if (keyboard.isKeyActive(keyboard.KEY_EMOTE)) + { + Item *item = mItems->getSelectedItem(); + + if(!item) + return; + + removeStore(item, item->getQuantity()); + } + } } Item *StorageWindow::getSelectedItem() const -- cgit v1.2.3-70-g09d2