summaryrefslogtreecommitdiff
path: root/src/gui/chat.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-01-09 21:24:13 -0700
committerIra Rice <irarice@gmail.com>2009-01-09 21:24:13 -0700
commit0dabbade690301ef89da2fb2562da8e48afc22d3 (patch)
treeaf73cc3f45c48dc0cf97b8c0fc3048f11eaaec03 /src/gui/chat.cpp
parent43630ab7969fa26cb0a3e2773e7266f2f9647867 (diff)
downloadmana-0dabbade690301ef89da2fb2562da8e48afc22d3.tar.gz
mana-0dabbade690301ef89da2fb2562da8e48afc22d3.tar.bz2
mana-0dabbade690301ef89da2fb2562da8e48afc22d3.tar.xz
mana-0dabbade690301ef89da2fb2562da8e48afc22d3.zip
Added the ability to see your own name in game.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r--src/gui/chat.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index 35976963..d4818504 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -95,8 +95,7 @@ ChatWindow::~ChatWindow()
delete mRecorder;
}
-void
- ChatWindow::logic()
+void ChatWindow::logic()
{
// todo: only do this when the size changes (updateWidgets?)
@@ -296,6 +295,15 @@ void ChatWindow::chatSend(const std::string &nick, std::string msg)
}
// Prepare ordinary message
if (msg.substr(0, 1) != "/") {
+ // The server never tells you about your own GM status, so work around
+ // this for now by intercepting it here. NOTE: This assumes that the
+ // assert works, when it's not guaranteed to.
+
+ std::size_t space = msg.find(" ");
+ const std::string command = msg.substr(1, space);
+ if (msg.at(0) == '@' && command == "assert")
+ player_node->setGM();
+
msg = nick + " : " + msg;
MessageOut outMsg(mNetwork);