Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-11-09 13:51:03 +0000
committerStijn Buys <ingar@osirion.org>2010-11-09 13:51:03 +0000
commit95f344ad62a4ab1aaf4b4d3307ce9805e2534d8e (patch)
tree29c8ed083b94bd5d90498be438276b104ed612db
parent7c024e9101a63be34a2c97ef0dc18deaa1afb175 (diff)
sort player names in the chat window
-rw-r--r--src/client/chat.cc21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/client/chat.cc b/src/client/chat.cc
index 8191e52..013d525 100644
--- a/src/client/chat.cc
+++ b/src/client/chat.cc
@@ -116,6 +116,7 @@ bool Chat::on_keypress(const int key, const unsigned int modifier)
if (chat_input->text().c_str()[0] == '/' || chat_input->text().c_str()[0] == '\\') {
core::cmd() << &chat_input->text().c_str()[1] << std::endl;
} else {
+ // FIXME semi-column ; truncates the command
core::cmd() << "say " << chat_input->text() << std::endl;
}
(*history.rbegin()) = chat_input->text();
@@ -166,23 +167,6 @@ bool Chat::on_keypress(const int key, const unsigned int modifier)
void Chat::draw()
{
- /*
- * this never worked before, event_draw is NOT virtual
-
- if (ui::console()->visible())
- return;
-
- if (!core::application()->connected()) {
- hide();
- return;
- }
-
- if (ui::root()->active()) {
- hide();
- return;
- }
- */
-
if (!chat_small && (chat_playerlist_timestamp != core::game()->playerlist_timestamp())) {
update_player_list();
}
@@ -197,8 +181,11 @@ void Chat::update_player_list()
for (core::GameInterface::Players::const_iterator it = core::game()->players().begin(); it != core::game()->players().end(); it++) {
ui::ListItem *listitem = new ui::ListItem(chat_playerlist, (*it)->name().c_str());
listitem->set_height(listitem->font()->height() * 1.5f);
+ listitem->set_sortkey(aux::text_strip_lowercase((*it)->name());
}
+ chat_playerlist->sort();
+
chat_playerlist_timestamp = core::game()->playerlist_timestamp();
}