summaryrefslogtreecommitdiff
path: root/src/gui/windows/npcdialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-01-08 23:07:23 +0300
committerAndrei Karas <akaras@inbox.ru>2016-01-08 23:07:23 +0300
commitc74a91d49f6afea0b23acc4d5b4543dfee5e64db (patch)
treef851e96a451605b244e7fe77b7ad2c57b54a29b5 /src/gui/windows/npcdialog.cpp
parent52865ff4b24e3ea85967e76099b73f2e581a856d (diff)
downloadmanaplus-c74a91d49f6afea0b23acc4d5b4543dfee5e64db.tar.gz
manaplus-c74a91d49f6afea0b23acc4d5b4543dfee5e64db.tar.bz2
manaplus-c74a91d49f6afea0b23acc4d5b4543dfee5e64db.tar.xz
manaplus-c74a91d49f6afea0b23acc4d5b4543dfee5e64db.zip
Allow drag & drop more than one amount at time in craft inventory.
Diffstat (limited to 'src/gui/windows/npcdialog.cpp')
-rw-r--r--src/gui/windows/npcdialog.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp
index 66cdc4bb3..2fcb53468 100644
--- a/src/gui/windows/npcdialog.cpp
+++ b/src/gui/windows/npcdialog.cpp
@@ -1370,3 +1370,24 @@ std::string NpcDialog::complexItemToStr(const ComplexItem *const item)
}
return str;
}
+
+void NpcDialog::addCraftItem(Item *const item,
+ const int amount,
+ const int slot)
+{
+ if (mInputState != NPC_INPUT_ITEM_CRAFT)
+ return;
+
+ Inventory *const inventory = PlayerInfo::getInventory();
+
+ if (!inventory)
+ return;
+
+ if (mComplexInventory->addVirtualItem(
+ item,
+ slot,
+ amount))
+ {
+ inventory->virtualRemove(item, amount);
+ }
+}