From 498eb532209e476e250b7b3e817533008faa85b2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 27 Jan 2016 18:07:33 +0300 Subject: Add chat commands for add/remove/ignore pickups. --- src/actions/commands.cpp | 36 ++++++++++++++++++++++++++++++++++++ src/actions/commands.h | 3 +++ src/dyetool/actions/commands.cpp | 5 ++++- src/enums/input/inputaction.h | 3 +++ src/input/inputactionmap.h | 18 ++++++++++++++++++ 5 files changed, 64 insertions(+), 1 deletion(-) diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 114144477..b57883841 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -1154,4 +1154,40 @@ impHandler(npcClipboard) return false; } +impHandler(addPickup) +{ + if (actorManager) + { + actorManager->addPickupItem(event.args); + if (socialWindow) + socialWindow->updatePickupFilter(); + return true; + } + return false; +} + +impHandler(removePickup) +{ + if (actorManager) + { + actorManager->removePickupItem(event.args); + if (socialWindow) + socialWindow->updatePickupFilter(); + return true; + } + return false; +} + +impHandler(ignorePickup) +{ + if (actorManager) + { + actorManager->addIgnorePickupItem(event.args); + if (socialWindow) + socialWindow->updatePickupFilter(); + return true; + } + return false; +} + } // namespace Actions diff --git a/src/actions/commands.h b/src/actions/commands.h index 451f84285..e49dcaddd 100644 --- a/src/actions/commands.h +++ b/src/actions/commands.h @@ -94,6 +94,9 @@ namespace Actions decHandler(skill); decHandler(craft); decHandler(npcClipboard); + decHandler(addPickup); + decHandler(removePickup); + decHandler(ignorePickup); } // namespace Actions #undef decHandler diff --git a/src/dyetool/actions/commands.cpp b/src/dyetool/actions/commands.cpp index 1f12d4777..a8fda78bd 100644 --- a/src/dyetool/actions/commands.cpp +++ b/src/dyetool/actions/commands.cpp @@ -93,6 +93,9 @@ impHandlerVoid(slide) impHandlerVoid(selectSkillLevel) impHandlerVoid(skill) impHandlerVoid(craft) -impHandlerVoid(npcClipboard); +impHandlerVoid(npcClipboard) +impHandlerVoid(addPickup) +impHandlerVoid(removePickup) +impHandlerVoid(ignorePickup) } // namespace Actions diff --git a/src/enums/input/inputaction.h b/src/enums/input/inputaction.h index e06572a2b..52fd75068 100644 --- a/src/enums/input/inputaction.h +++ b/src/enums/input/inputaction.h @@ -619,6 +619,9 @@ enumStart(InputAction) CRAFT, CHAT_CLIPBOARD, NPC_CLIPBOARD, + ADD_PICKUP, + REMOVE_PICKUP, + IGNORE_PICKUP, TOTAL } enumEnd(InputAction); diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index 0f47fe638..586557c0e 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -5203,6 +5203,24 @@ static const InputActionData inputActionData "npcclipboard", UseArgs_true, Protected_true}, + {"keyAddPickup", + defaultAction(&Actions::addPickup), + InputCondition::INGAME, + "addpickup|pickupadd", + UseArgs_true, + Protected_true}, + {"keyRemovePickup", + defaultAction(&Actions::removePickup), + InputCondition::INGAME, + "removepickup|pickupremove", + UseArgs_true, + Protected_true}, + {"keyIgnorePickup", + defaultAction(&Actions::ignorePickup), + InputCondition::INGAME, + "ignorepickup|pickupignore", + UseArgs_true, + Protected_true}, }; #undef defaultAction -- cgit v1.2.3-70-g09d2