diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-01-08 23:07:23 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-01-08 23:07:23 +0300 |
commit | c74a91d49f6afea0b23acc4d5b4543dfee5e64db (patch) | |
tree | f851e96a451605b244e7fe77b7ad2c57b54a29b5 /src/gui/windows/npcdialog.cpp | |
parent | 52865ff4b24e3ea85967e76099b73f2e581a856d (diff) | |
download | plus-c74a91d49f6afea0b23acc4d5b4543dfee5e64db.tar.gz plus-c74a91d49f6afea0b23acc4d5b4543dfee5e64db.tar.bz2 plus-c74a91d49f6afea0b23acc4d5b4543dfee5e64db.tar.xz plus-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.cpp | 21 |
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); + } +} |