diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/actions/actions.cpp | 8 | ||||
-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, 19 insertions, 0 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index e4b2d9db5..e689db941 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -1501,4 +1501,12 @@ impHandler(protectItem) return true; } +impHandler(unprotectItem) +{ + const int id = atoi(event.args.c_str()); + if (id > 0) + PlayerInfo::unprotectItem(id); + return true; +} + } // namespace Actions diff --git a/src/actions/actions.h b/src/actions/actions.h index 45dc96f11..cbd7489f3 100644 --- a/src/actions/actions.h +++ b/src/actions/actions.h @@ -102,6 +102,7 @@ namespace Actions decHandler(tradeAdd); decHandler(storageToInv); decHandler(protectItem); + decHandler(unprotectItem); } // namespace Actions #undef decHandler diff --git a/src/input/inputaction.h b/src/input/inputaction.h index 8e926b368..efd606db9 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -509,6 +509,7 @@ namespace InputAction TRADE_ADD, STORAGE_TO_INV, ITEM_PROTECT, + ITEM_UNPROTECT, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index ab2a8ea29..146ecba1c 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -4324,6 +4324,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputCondition::INGAME, "protectitem|itemprotect", true}, + {"keyUnProtectItem", + InputType::UNKNOWN, InputAction::NO_VALUE, + InputType::UNKNOWN, InputAction::NO_VALUE, + Input::GRP_DEFAULT, + &Actions::unprotectItem, + InputAction::NO_VALUE, 50, + InputCondition::INGAME, + "unprotectitem|itemunprotect", + true}, }; #endif // INPUT_INPUTACTIONMAP_H |