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>2011-05-31 13:17:14 +0000
committerStijn Buys <ingar@osirion.org>2011-05-31 13:17:14 +0000
commitb7d62e90a7a0e4e404623af0c646495a3dd3fd2b (patch)
treea8c15b9a40428e5c7bb03138a9260f16f4e3daf4 /src/client/chat.cc
parent1c63cbf204b1d2c667ce9f821ccb197d0ffb0ac3 (diff)
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
Diffstat (limited to 'src/client/chat.cc')
-rw-r--r--src/client/chat.cc15
1 files changed, 13 insertions, 2 deletions
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();
}