summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMadCamel <madcamel@gmail.com>2009-02-11 19:24:14 -0500
committerIra Rice <irarice@gmail.com>2009-02-11 18:27:06 -0700
commit70aff3a9f745e23fcfa11db92563d0ed17449c32 (patch)
tree9d1927a602fe49235d1e96dd8b0159fcc6acb465
parent6b8c469e2c425696f9138d6d19ddfe16824e9ec5 (diff)
downloadmana-70aff3a9f745e23fcfa11db92563d0ed17449c32.tar.gz
mana-70aff3a9f745e23fcfa11db92563d0ed17449c32.tar.bz2
mana-70aff3a9f745e23fcfa11db92563d0ed17449c32.tar.xz
mana-70aff3a9f745e23fcfa11db92563d0ed17449c32.zip
Implemented /me
-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 fbd24377..48b49248 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -138,6 +138,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)
{
@@ -595,6 +605,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);