diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/actions/actions.cpp | 13 | ||||
-rw-r--r-- | src/actions/actions.h | 1 | ||||
-rw-r--r-- | src/input/inputaction.h | 1 | ||||
-rw-r--r-- | src/input/inputactionmap.h | 9 |
4 files changed, 24 insertions, 0 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index c3b2faf9f..0b501bdbf 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -1408,4 +1408,17 @@ impHandler(invToStorage10) return true; } +impHandler(invToStorageHalf) +{ + Item *const item = getItemByInvIndex(event); + if (!item) + return true; + + inventoryHandler->moveItem2(Inventory::INVENTORY, + item->getInvIndex(), + item->getQuantity() / 2, + Inventory::STORAGE); + return true; +} + } // namespace Actions diff --git a/src/actions/actions.h b/src/actions/actions.h index ef74562eb..0ab312351 100644 --- a/src/actions/actions.h +++ b/src/actions/actions.h @@ -100,6 +100,7 @@ namespace Actions decHandler(useItemInv); decHandler(invToStorage); decHandler(invToStorage10); + decHandler(invToStorageHalf); } // namespace Actions #undef decHandler diff --git a/src/input/inputaction.h b/src/input/inputaction.h index 774053226..2cbfe8ab1 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -507,6 +507,7 @@ namespace InputAction USE_INV, INV_TO_STORAGE, INV_TO_STORAGE_10, + INV_TO_STORAGE_HALF, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index 794fcb97d..03a199e38 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -4306,6 +4306,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputCondition::INGAME, "invtostorage10|invstorage10", true}, + {"keyInvToStorageHalf", + InputType::UNKNOWN, InputAction::NO_VALUE, + InputType::UNKNOWN, InputAction::NO_VALUE, + Input::GRP_DEFAULT, + &Actions::invToStorageHalf, + InputAction::NO_VALUE, 50, + InputCondition::INGAME, + "invtostoragehalf|invstoragehalf", + true}, }; #endif // INPUT_INPUTACTIONMAP_H |