summaryrefslogtreecommitdiff
path: root/src/gui/windows/chatwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-04-06 01:31:12 +0300
committerAndrei Karas <akaras@inbox.ru>2017-04-06 01:31:12 +0300
commitd4e28aa97cbce34a0053d3c02cf070ef9065439f (patch)
tree8e7300771b93caeed5faefbe709bd0720766e755 /src/gui/windows/chatwindow.cpp
parentbe163616712f8c360af9b3940969c7f127043dc0 (diff)
downloadmv-d4e28aa97cbce34a0053d3c02cf070ef9065439f.tar.gz
mv-d4e28aa97cbce34a0053d3c02cf070ef9065439f.tar.bz2
mv-d4e28aa97cbce34a0053d3c02cf070ef9065439f.tar.xz
mv-d4e28aa97cbce34a0053d3c02cf070ef9065439f.zip
Add quick messages with translation from current server language to default.
For use it open emotes/fonts in chat and select T tab.
Diffstat (limited to 'src/gui/windows/chatwindow.cpp')
-rw-r--r--src/gui/windows/chatwindow.cpp18
1 files changed, 18 insertions, 0 deletions
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 <sys/stat.h>
#include <sstream>
@@ -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)