summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/windows/chatwindow.cpp22
-rw-r--r--src/gui/windows/chatwindow.h2
2 files changed, 23 insertions, 1 deletions
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index d6bca3781..992932084 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -1479,9 +1479,17 @@ bool ChatWindow::resortChatLog(std::string line, Own own,
const size_t idx = line.find(": \302\202");
if (idx == idx2)
{
- // ignore special message formats.
if (line.find(": \302\202\302") != std::string::npos)
+ {
+ if (line.find(": \302\202\302e") != std::string::npos)
+ {
+ const std::string nick = line.substr(0, idx2 - 1);
+ line = line.substr(idx2 + 6);
+ localPetEmote(nick, atoi(line.c_str()));
+ }
+ // ignore other special message formats.
return false;
+ }
// pet talk message detected
if (line.find(": \302\202\303 ") != std::string::npos)
@@ -1587,6 +1595,18 @@ void ChatWindow::localPetSay(const std::string &nick, const std::string &text)
}
}
+void ChatWindow::localPetEmote(const std::string &nick, const uint8_t emoteId)
+{
+ Being *const being = actorManager->findBeingByName(
+ nick, ActorSprite::PLAYER);
+ if (being)
+ {
+ Being *const pet = being->getPet();
+ if (pet)
+ pet->setEmote(emoteId, 0);
+ }
+}
+
void ChatWindow::initTradeFilter()
{
const std::string tradeListName = client->getServerConfigDirectory()
diff --git a/src/gui/windows/chatwindow.h b/src/gui/windows/chatwindow.h
index 8cda0fa84..64db4d1df 100644
--- a/src/gui/windows/chatwindow.h
+++ b/src/gui/windows/chatwindow.h
@@ -294,6 +294,8 @@ class ChatWindow final : public Window,
void localPetSay(const std::string &nick, const std::string &text);
+ void localPetEmote(const std::string &nick, const uint8_t emoteId);
+
#ifdef USE_PROFILER
void logicChildren();
#endif