summaryrefslogtreecommitdiff
path: root/src/gui/chat.cpp
diff options
context:
space:
mode:
authorFreeyorp <freeyorp101@hotmail.com>2009-04-26 12:03:55 +1200
committerJared Adams <jaxad0127@gmail.com>2009-05-02 09:45:37 -0600
commit672f0be78bbd818a67728a0446cb0caf153c5d97 (patch)
treeac5345bab18f8ada4be987ca5faabe4b2dd75091 /src/gui/chat.cpp
parente2845dd7529a4dfe33a41e136acee116a235e54b (diff)
downloadmana-672f0be78bbd818a67728a0446cb0caf153c5d97.tar.gz
mana-672f0be78bbd818a67728a0446cb0caf153c5d97.tar.bz2
mana-672f0be78bbd818a67728a0446cb0caf153c5d97.tar.xz
mana-672f0be78bbd818a67728a0446cb0caf153c5d97.zip
Extend the /present command.
/present will now output the number of players present in addition to the names of players that are present.
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r--src/gui/chat.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index a830f556..e37bdf78 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -309,7 +309,8 @@ void ChatWindow::doPresent()
{
const Beings &beings = beingManager->getAll();
std::string response = "";
-
+ unsigned short playercount = 0;
+ char cpc[25];
for (Beings::const_iterator bi = beings.begin(), be = beings.end();
bi != be; ++bi)
{
@@ -320,9 +321,10 @@ void ChatWindow::doPresent()
response += ", ";
}
response += (*bi)->getName();
+ ++playercount;
}
}
-
+ sprintf(cpc,"%u players are present.",playercount);
if (mRecorder->isRecording())
{
// Get the current system time
@@ -338,13 +340,13 @@ void ChatWindow::doPresent()
<< "] ";
- mRecorder->record(timeStr.str() + _("Present: ") + response + ".");
+ mRecorder->record(timeStr.str() + _("Present: ") + response + _("; ") + cpc);
getFocused()->chatLog(_("Attendance written to record log."),
BY_SERVER, true);
}
else
{
- getFocused()->chatLog(_("Present: ") + response, BY_SERVER);
+ getFocused()->chatLog(_("Present: ") + response + _("; ") + cpc, BY_SERVER);
}
}