From 1e0df536c2fae85c317ce9c3cc17603d5f98c911 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 15 Oct 2008 20:33:15 +0000 Subject: moved client console into a Widget --- src/client/chat.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/client/chat.cc') diff --git a/src/client/chat.cc b/src/client/chat.cc index 87ba437..6d294ba 100644 --- a/src/client/chat.cc +++ b/src/client/chat.cc @@ -6,15 +6,14 @@ #include "auxiliary/functions.h" #include "client/chat.h" -#include "client/client.h" -#include "client/console.h" #include "core/core.h" -#include "render/render.h" #include "sys/sys.h" #include "ui/ui.h" namespace client { +const size_t DEFAULT_MAX_HISTO_LINES = 512; + Chat::Chat(ui::Widget *parent) : ui::Window(parent) { set_label("chat"); @@ -83,7 +82,7 @@ bool Chat::on_keypress(const int key, const unsigned int modifier) (*history_pos).assign(chat_input->text()); // store input into history - while (history.size() >= MAXHISTOLINES) { + while (history.size() >= DEFAULT_MAX_HISTO_LINES) { history.pop_front(); } @@ -127,7 +126,7 @@ bool Chat::on_keypress(const int key, const unsigned int modifier) void Chat::event_draw() { - if (!client()->connected()) { + if (!core::application()->connected()) { hide(); return; } -- cgit v1.2.3