Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/chat.cc14
-rw-r--r--src/client/chat.h2
2 files changed, 15 insertions, 1 deletions
diff --git a/src/client/chat.cc b/src/client/chat.cc
index 8a09883..c49550e 100644
--- a/src/client/chat.cc
+++ b/src/client/chat.cc
@@ -103,6 +103,18 @@ void Chat::toggle()
show();
}
+bool Chat::on_emit(ui::Widget *sender, const ui::Widget::Event event, void *data)
+{
+ if (sender == chat_closebutton) {
+ if (event == ui::Widget::EventButtonClicked) {
+ hide();
+ return true;
+ }
+ }
+
+ return Window::on_emit(sender, event, data);
+}
+
bool Chat::on_keypress(const int key, const unsigned int modifier)
{
// number of lines to scroll
@@ -250,7 +262,7 @@ void Chat::resize()
chat_playerlist->set_size(ui::UI::elementsize.width() * 1.5f, height() - chat_playerlist->top() - padding * 2.0f);
// resize chat text pane
- chat_scrollpane->set_location(chat_playerlist->right() + padding, padding);
+ chat_scrollpane->set_location(chat_playerlist->right() + padding, chat_titlelabel->bottom() + padding);
chat_scrollpane->set_size(width() - chat_scrollpane->left() - padding, chat_playerlist->height());
}
diff --git a/src/client/chat.h b/src/client/chat.h
index ca0ff72..9b64297 100644
--- a/src/client/chat.h
+++ b/src/client/chat.h
@@ -45,6 +45,8 @@ protected:
virtual bool on_keypress(const int key, const unsigned int modifier);
+ virtual bool on_emit(ui::Widget *sender, const ui::Widget::Event event, void *data);
+
/**
* @brief set the chatbox prompt to 'say:' or 'command:' depending on the current input text.
*/