From b7d62e90a7a0e4e404623af0c646495a3dd3fd2b Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 31 May 2011 13:17:14 +0000 Subject: Removed a forced recalculateLocalAabb for compound shapes, semi-colon in chat messages doesn't truncate the chat text any more, changed chat prompt to "Command:" if the first character is a slash, small misc cleanups --- src/client/chat.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/client/chat.cc') diff --git a/src/client/chat.cc b/src/client/chat.cc index bdce6d8..cf995cb 100644 --- a/src/client/chat.cc +++ b/src/client/chat.cc @@ -34,7 +34,7 @@ Chat::Chat(ui::Widget *parent) : ui::Window(parent) chat_input = new ui::InputBox(this); chat_input->set_border(false); - chat_input->set_prompt("^BSay^F:^B "); + set_prompt(); chat_input->set_focus(); set_background(true); @@ -117,7 +117,8 @@ bool Chat::on_keypress(const int key, const unsigned int modifier) 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; + //core::cmd() << "say " << chat_input->text() << std::endl; + client()->say(chat_input->text()); } (*history.rbegin()) = chat_input->text(); @@ -165,12 +166,22 @@ bool Chat::on_keypress(const int key, const unsigned int modifier) return false; } +void Chat::set_prompt() +{ + if (chat_input->text().size() && chat_input->text()[0] == '/') { + chat_input->set_prompt("^BCommand^F:^B "); + } else { + chat_input->set_prompt("^BSay^F:^B "); + } +} + void Chat::draw() { if (!chat_small && (chat_playerlist_timestamp != core::game()->playerlist_timestamp())) { update_player_list(); } + set_prompt(); ui::Window::draw(); } -- cgit v1.2.3