diff options
Diffstat (limited to 'src/gui/chatwindow.cpp')
-rw-r--r-- | src/gui/chatwindow.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp index fe6194b23..521877ca3 100644 --- a/src/gui/chatwindow.cpp +++ b/src/gui/chatwindow.cpp @@ -37,6 +37,7 @@ #include "spellshortcut.h" #include "soundmanager.h" +#include "gui/emotewindow.h" #include "gui/gui.h" #include "gui/setup.h" #include "gui/sdlfont.h" @@ -251,6 +252,9 @@ ChatWindow::ChatWindow(): setTitleBarHeight(getPadding() + getTitlePadding()); + if (emoteWindow) + emoteWindow->addListeners(this); + mChatTabs->enableScrollButtons(true); mChatTabs->setFollowDownScroll(true); mChatTabs->setResizeHeight(false); @@ -481,6 +485,18 @@ void ChatWindow::action(const gcn::ActionEvent &event) setVisible(false); } } + else if (eventId == "emote") + { + if (emoteWindow) + { + const std::string str = emoteWindow->getSelectedEmote(); + if (!str.empty()) + { + addInputText(str, false); + emoteWindow->clearEmote(); + } + } + } else if (eventId == ACTION_COLOR_PICKER) { if (mColorPicker) @@ -849,6 +865,10 @@ void ChatWindow::keyPressed(gcn::KeyEvent &event) std::string temp; switch (key) { + case Key::F1: + if (emoteWindow) + emoteWindow->show(); + break; caseKey(Key::F2, "\u2318"); caseKey(Key::F3, "\u263A"); caseKey(Key::F4, "\u2665"); |