summaryrefslogtreecommitdiff
path: root/src/gui/chat.cpp
diff options
context:
space:
mode:
authorMadCamel <madcamel@gmail.com>2009-02-11 19:24:14 -0500
committerJared Adams <jaxad0127@gmail.com>2009-02-11 18:22:06 +0000
commita53b5a9482091178d122f4740cb41132a2dd1861 (patch)
tree198eced704fb48c396e58b61119af0bbfdcd1fe7 /src/gui/chat.cpp
parent37f0aeb23e60d3960bd0f8164d60fec951ebcd8c (diff)
downloadmana-a53b5a9482091178d122f4740cb41132a2dd1861.tar.gz
mana-a53b5a9482091178d122f4740cb41132a2dd1861.tar.bz2
mana-a53b5a9482091178d122f4740cb41132a2dd1861.tar.xz
mana-a53b5a9482091178d122f4740cb41132a2dd1861.zip
Implemented /me
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r--src/gui/chat.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index 38a83ce0..81aa4dfd 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -137,6 +137,16 @@ void ChatWindow::chatLog(std::string line, int own, bool ignoreRecord)
}
}
+ // *implements actions in a backwards compatible way*
+ if (own == BY_PLAYER &&
+ tmp.text.at(0) == '*' &&
+ tmp.text.at(tmp.text.length()-1) == '*')
+ {
+ tmp.text[0] = ' ';
+ tmp.text.erase(tmp.text.length() - 1);
+ own = ACT_IS;
+ }
+
std::string lineColor = "##C";
switch (own)
{
@@ -597,6 +607,12 @@ void ChatWindow::chatSend(const std::string &nick, std::string msg)
chatLog(_("Present: ") + response, BY_SERVER);
}
}
+ else if (command == "me")
+ {
+ std::stringstream actionStr;
+ actionStr << "*" << msg << "*";
+ chatSend(player_node->getName(), actionStr.str());
+ }
else
{
chatLog(_("Unknown command"), BY_SERVER);