summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/actions/actions.cpp16
-rw-r--r--src/actions/actions.h1
-rw-r--r--src/input/inputaction.h1
-rw-r--r--src/input/inputactionmap.h9
4 files changed, 27 insertions, 0 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp
index 8cd2600b4..da62c6549 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -380,6 +380,22 @@ impHandler(dropItemId)
return true;
}
+impHandler(dropItemInv)
+{
+ const Inventory *const inv = PlayerInfo::getInventory();
+ if (!inv)
+ return false;
+
+ Item *const item = inv->getItem(atoi(event.args.c_str()));
+
+ if (item && !PlayerInfo::isItemProtected(item->getId()))
+ {
+ ItemAmountWindow::showWindow(ItemAmountWindow::ItemDrop,
+ inventoryWindow, item);
+ }
+ return true;
+}
+
impHandler(dropItemIdAll)
{
const Inventory *const inv = PlayerInfo::getInventory();
diff --git a/src/actions/actions.h b/src/actions/actions.h
index 11a3bcdcf..ab7f5b980 100644
--- a/src/actions/actions.h
+++ b/src/actions/actions.h
@@ -39,6 +39,7 @@ namespace Actions
decHandler(dropItem0);
decHandler(dropItem);
decHandler(dropItemId);
+ decHandler(dropItemInv);
decHandler(dropItemIdAll);
decHandler(heal);
decHandler(itenplz);
diff --git a/src/input/inputaction.h b/src/input/inputaction.h
index 9d2e64993..fc14b1ad2 100644
--- a/src/input/inputaction.h
+++ b/src/input/inputaction.h
@@ -502,6 +502,7 @@ namespace InputAction
CAMERA_MOVE,
DROP_ITEM,
DROP_ITEM_ALL,
+ DROP_INV,
TOTAL
};
} // namespace InputAction
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index 3b0854cfc..7859808b5 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -4261,6 +4261,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = {
InputCondition::INGAME,
"dropitemall",
true},
+ {"keyDropInv",
+ InputType::UNKNOWN, InputAction::NO_VALUE,
+ InputType::UNKNOWN, InputAction::NO_VALUE,
+ Input::GRP_DEFAULT,
+ &Actions::dropItemInv,
+ InputAction::NO_VALUE, 50,
+ InputCondition::INGAME,
+ "dropinv",
+ true},
};
#endif // INPUT_INPUTACTIONMAP_H