aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-08-30 14:24:23 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-08-30 14:24:23 +0300
commitba0322f353b8dd583bd3a5cbb4549d8a82fc71f0 (patch)
tree84cdd91effcf08e02b099d471316aa4c00abd677
parent1a705523c09a914243d18ae337905de0a1b3de91 (diff)
parente278742c5e0fc644c571aa5a688ea72c34aaea25 (diff)
downloadminetest-ba0322f353b8dd583bd3a5cbb4549d8a82fc71f0.tar.gz
minetest-ba0322f353b8dd583bd3a5cbb4549d8a82fc71f0.tar.bz2
minetest-ba0322f353b8dd583bd3a5cbb4549d8a82fc71f0.zip
Merge remote-tracking branch 'queatz/mmb10'
-rw-r--r--src/guiInventoryMenu.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/guiInventoryMenu.cpp b/src/guiInventoryMenu.cpp
index 8faf3d005..bf955a43e 100644
--- a/src/guiInventoryMenu.cpp
+++ b/src/guiInventoryMenu.cpp
@@ -309,10 +309,17 @@ bool GUIInventoryMenu::OnEvent(const SEvent& event)
}
if(event.EventType==EET_MOUSE_INPUT_EVENT)
{
- if(event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN
- || event.MouseInput.Event == EMIE_RMOUSE_PRESSED_DOWN)
+ char amount = -1;
+
+ if(event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN)
+ amount = 0;
+ else if(event.MouseInput.Event == EMIE_RMOUSE_PRESSED_DOWN)
+ amount = 1;
+ else if(event.MouseInput.Event == EMIE_MMOUSE_PRESSED_DOWN)
+ amount = 10;
+
+ if(amount >= 0)
{
- bool right = (event.MouseInput.Event == EMIE_RMOUSE_PRESSED_DOWN);
v2s32 p(event.MouseInput.X, event.MouseInput.Y);
//dstream<<"Mouse down at p=("<<p.X<<","<<p.Y<<")"<<std::endl;
ItemSpec s = getItemAtPos(p);
@@ -343,7 +350,7 @@ bool GUIInventoryMenu::OnEvent(const SEvent& event)
{
dstream<<"Handing IACTION_MOVE to manager"<<std::endl;
IMoveAction *a = new IMoveAction();
- a->count = right ? 1 : 0;
+ a->count = amount;
a->from_inv = m_selected_item->inventoryname;
a->from_list = m_selected_item->listname;
a->from_i = m_selected_item->i;
@@ -358,7 +365,7 @@ bool GUIInventoryMenu::OnEvent(const SEvent& event)
}
// Remove selection if target was left-clicked or source
// slot was emptied
- if(right == false || source_empties)
+ if(amount == 0 || source_empties)
{
delete m_selected_item;
m_selected_item = NULL;