diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/actions/chat.cpp | 17 | ||||
-rw-r--r-- | src/actions/chat.h | 1 | ||||
-rw-r--r-- | src/input/inputaction.h | 1 | ||||
-rw-r--r-- | src/input/inputactionmap.h | 9 |
4 files changed, 28 insertions, 0 deletions
diff --git a/src/actions/chat.cpp b/src/actions/chat.cpp index 2c7d84f91..59b69b911 100644 --- a/src/actions/chat.cpp +++ b/src/actions/chat.cpp @@ -20,6 +20,7 @@ #include "actions/chat.h" +#include "configuration.h" #include "guildmanager.h" #include "actions/actiondef.h" @@ -244,6 +245,22 @@ impHandler(msg) return true; } +impHandler(msgText) +{ + if (!chatWindow) + return false; + + if (config.getBoolValue("whispertab")) + { + chatWindow->localChatInput("/q " + event.args); + } + else + { + chatWindow->addInputText(std::string("/w \"").append( + event.args).append("\" ")); + } +} + impHandler(msg2) { std::string recvnick; diff --git a/src/actions/chat.h b/src/actions/chat.h index 459ee675d..c42e4940b 100644 --- a/src/actions/chat.h +++ b/src/actions/chat.h @@ -36,6 +36,7 @@ namespace Actions decHandler(scrollChatUp); decHandler(scrollChatDown); decHandler(msg); + decHandler(msgText); decHandler(msg2); decHandler(query); decHandler(clearChatTab); diff --git a/src/input/inputaction.h b/src/input/inputaction.h index 28bb44fd8..0287e3f42 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -497,6 +497,7 @@ namespace InputAction NUKE, USE, CHAT_ADD, + WHISPER_TEXT, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index b25dfe848..08d7bbf7a 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -4216,6 +4216,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputCondition::INGAME, "addchat|chatadd", true}, + {"keyWhisperText", + InputType::UNKNOWN, InputAction::NO_VALUE, + InputType::UNKNOWN, InputAction::NO_VALUE, + Input::GRP_DEFAULT, + &Actions::msgText, + InputAction::NO_VALUE, 50, + InputCondition::INGAME, + "wt|whispertext|msgtext", + true}, }; #endif // INPUT_INPUTACTIONMAP_H |