diff options
author | Stijn Buys <ingar@osirion.org> | 2010-11-09 13:51:03 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2010-11-09 13:51:03 +0000 |
commit | 95f344ad62a4ab1aaf4b4d3307ce9805e2534d8e (patch) | |
tree | 29c8ed083b94bd5d90498be438276b104ed612db /src | |
parent | 7c024e9101a63be34a2c97ef0dc18deaa1afb175 (diff) |
sort player names in the chat window
Diffstat (limited to 'src')
-rw-r--r-- | src/client/chat.cc | 21 |
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(); } |