aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorasl97 <asl97@airmail.cc>2017-10-18 03:50:58 +0800
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-10-17 21:50:58 +0200
commit38b0e2667928ab75737c9dd7a13769d5d8d7072c (patch)
treecb334624f35d5fa63b3f659eb07f6249109063e1
parent5e24ca05fd91a7870983858f02b4f6cf7b496a06 (diff)
downloadminetest-38b0e2667928ab75737c9dd7a13769d5d8d7072c.tar.gz
minetest-38b0e2667928ab75737c9dd7a13769d5d8d7072c.tar.bz2
minetest-38b0e2667928ab75737c9dd7a13769d5d8d7072c.zip
Fix inventory drag drop flag (#6416)
-rw-r--r--src/guiFormSpecMenu.cpp14
-rw-r--r--src/guiFormSpecMenu.h2
2 files changed, 8 insertions, 8 deletions
diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp
index 0482f59a4..0691bc598 100644
--- a/src/guiFormSpecMenu.cpp
+++ b/src/guiFormSpecMenu.cpp
@@ -3449,7 +3449,7 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
// no shift: select item
m_selected_amount = count;
m_selected_dragging = true;
- m_rmouse_auto_place = false;
+ m_auto_place = false;
} else {
// shift pressed: move item
if (button != 1)
@@ -3507,11 +3507,11 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
}
m_selected_dragging = false;
- // Keep count of how many times right mouse button has been
- // clicked. One click is drag without dropping. Click + release
- // + click changes to drop one item when moved mode
- if (button == 1 && m_selected_item != NULL)
- m_rmouse_auto_place = !m_rmouse_auto_place;
+ // Keep track of whether the mouse button be released
+ // One click is drag without dropping. Click + release
+ // + click changes to drop item when moved mode
+ if (m_selected_item)
+ m_auto_place = true;
} else if (updown == -1) {
// Mouse has been moved and rmb is down and mouse pointer just
// entered a new inventory field (checked in the entry-if, this
@@ -3519,7 +3519,7 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
if (m_selected_item != NULL && s.isValid()) {
// Move 1 item
// TODO: middle mouse to move 10 items might be handy
- if (m_rmouse_auto_place) {
+ if (m_auto_place) {
// Only move an item if the destination slot is empty
// or contains the same item type as what is going to be
// moved
diff --git a/src/guiFormSpecMenu.h b/src/guiFormSpecMenu.h
index 7c283dcc0..071efb37f 100644
--- a/src/guiFormSpecMenu.h
+++ b/src/guiFormSpecMenu.h
@@ -411,7 +411,7 @@ protected:
u64 m_hovered_time = 0;
s32 m_old_tooltip_id = -1;
- bool m_rmouse_auto_place = false;
+ bool m_auto_place = false;
bool m_allowclose = true;
bool m_lock = false;