From d4e28aa97cbce34a0053d3c02cf070ef9065439f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 6 Apr 2017 01:31:12 +0300 Subject: Add quick messages with translation from current server language to default. For use it open emotes/fonts in chat and select T tab. --- src/gui/windows/chatwindow.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/gui/windows/chatwindow.cpp') diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index d81775b43..6e4cb591e 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -68,12 +68,16 @@ #include "render/opengl/opengldebug.h" +#include "resources/db/textdb.h" + #include "net/chathandler.h" #include "net/serverfeatures.h" #include "utils/copynpaste.h" #include "utils/delete2.h" +#include "utils/translation/podict.h" + #include #include @@ -497,6 +501,20 @@ void ChatWindow::action(const ActionEvent &event) } } } + else if (eventId == "text") + { + if (emoteWindow && reverseDictionary) + { + const int idx = emoteWindow->getSelectedTextIndex(); + if (idx >= 0) + { + const std::string str = TextDb::getByIndex(idx); + const std::string enStr = reverseDictionary->getStr(str); + addInputText(enStr, false); + } + emoteWindow->clearText(); + } + } else if (eventId == ACTION_COLOR_PICKER) { if (mColorPicker) -- cgit v1.2.3-70-g09d2