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>2008-10-16 16:34:15 +0000
committerStijn Buys <ingar@osirion.org>2008-10-16 16:34:15 +0000
commit1a28393dabf4f4696bf433ddde52e7a25253c955 (patch)
tree4d4fa4034f30fc882a78ab6ea148a32e83b9e88c /src/client/chat.cc
parent1e0df536c2fae85c317ce9c3cc17603d5f98c911 (diff)
various user interface related updates
Diffstat (limited to 'src/client/chat.cc')
-rw-r--r--src/client/chat.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/client/chat.cc b/src/client/chat.cc
index 6d294ba..9d51adc 100644
--- a/src/client/chat.cc
+++ b/src/client/chat.cc
@@ -23,9 +23,10 @@ Chat::Chat(ui::Widget *parent) : ui::Window(parent)
chat_label = new ui::Label(this, "^BSay^F:^B");
chat_label->set_alignment(ui::AlignLeft | ui::AlignVCenter);
+ chat_label->set_border(false);
- chat_input = new ui::Input(this);
- chat_input->set_border(true);
+ chat_input = new ui::InputBox(this);
+ chat_input->set_border(false);
chat_input->set_focus();
@@ -79,19 +80,17 @@ bool Chat::on_keypress(const int key, const unsigned int modifier)
}
case SDLK_RETURN:
if (chat_input->text().size()) {
- (*history_pos).assign(chat_input->text());
-
// store input into history
while (history.size() >= DEFAULT_MAX_HISTO_LINES) {
history.pop_front();
}
- if ((*history_pos).c_str()[0] == '/' || (*history_pos).c_str()[0] == '\\') {
- core::cmd() << &(*history_pos).c_str()[1] << std::endl;
+ if (chat_input->text().c_str()[0] == '/' || chat_input->text().c_str()[0] == '\\') {
+ core::cmd() << &chat_input->text().c_str()[1] << std::endl;
} else {
- core::cmd() << "say " << (*history_pos) << std::endl;
+ core::cmd() << "say " << chat_input->text() << std::endl;
}
- (*history.rbegin()) = (*history_pos);
+ (*history.rbegin()) = chat_input->text();
history.push_back("");
history_pos = history.rbegin();