summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-10-30 00:11:35 +0300
committerAndrei Karas <akaras@inbox.ru>2015-10-30 00:11:35 +0300
commit1b653c7c1a3e6c5d7b2739f881ea6b11ca46cd3b (patch)
treede98074d774b203053c4215a49764837a3b007ed /src/gui
parent598de45a1e77e5f10c69694f607941336163673f (diff)
downloadmanaverse-1b653c7c1a3e6c5d7b2739f881ea6b11ca46cd3b.tar.gz
manaverse-1b653c7c1a3e6c5d7b2739f881ea6b11ca46cd3b.tar.bz2
manaverse-1b653c7c1a3e6c5d7b2739f881ea6b11ca46cd3b.tar.xz
manaverse-1b653c7c1a3e6c5d7b2739f881ea6b11ca46cd3b.zip
Allow add item by drag&drop into npc inventory to exact position.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/itemcontainer.cpp5
-rw-r--r--src/gui/windows/npcdialog.cpp2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index 8fc8b09e4..fec14b814 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -631,8 +631,9 @@ void ItemContainer::mouseReleased(MouseEvent &event)
inventory = PlayerInfo::getInventory();
if (inventory)
{
- mInventory->addVirtualItem(inventory->getItem(
- dragDrop.getTag()));
+ mInventory->addVirtualItem(
+ inventory->getItem(dragDrop.getTag()),
+ getSlotIndex(event.getX(), event.getY()));
}
return;
}
diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp
index 5cc538e34..f601c6405 100644
--- a/src/gui/windows/npcdialog.cpp
+++ b/src/gui/windows/npcdialog.cpp
@@ -542,7 +542,7 @@ void NpcDialog::action(const ActionEvent &event)
else if (eventId == "add")
{
if (inventoryWindow)
- mInventory->addVirtualItem(inventoryWindow->getSelectedItem());
+ mInventory->addVirtualItem(inventoryWindow->getSelectedItem(), 0);
}
else if (eventId.find("skin_") == 0)
{