From 8ccfd7747bddf3fad75b0f358a64e66646b54032 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 19 Oct 2008 17:16:39 +0000 Subject: ui_chat and ui_chatsmall --- src/client/view.cc | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/client/view.cc') diff --git a/src/client/view.cc b/src/client/view.cc index 771f63a..8eaf63f 100644 --- a/src/client/view.cc +++ b/src/client/view.cc @@ -208,16 +208,12 @@ void View::resize() { set_size(parent()->size()); - // reposition chat widget - view_chat->set_size(font()->width()*64, height() * 0.5f); - view_chat->set_location(font()->width(), height() - view_chat->height() - font()->height() * 4); - // reposition devinfo widget view_devinfo->set_size(font()->width()*32, font()->height()*5); view_devinfo->set_location(font()->width() * 0.5f, font()->height() * 0.5f); // reposition notifications widget - view_notify->set_location(font()->width(), view_devinfo->top() + view_devinfo->height() + font()->width()); + view_notify->set_location(font()->width(), view_devinfo->top() + view_devinfo->height() + font()->height()); view_notify->set_size(width() - font()->width() * 2, height() * 0.5f - view_notify->top()); // reposition stats widget @@ -237,12 +233,24 @@ void View::resize() void View::draw() { + // reposition chat widget + if (!view_chat->small()) { + view_chat->set_location(font()->width(), view_devinfo->top() + view_devinfo->height() + font()->height()); + view_chat->set_size(width() - font()->width() * 16, height() - view_chat->top() - font()->height() * 8); + } else { + view_chat->set_size(width() - font()->width() * 16, font()->height() * 2); + view_chat->set_location(font()->width(), height() - font()->height() * 8 - view_chat->height()); + } + view_chat->event_resize(); + view_devinfo->set_visible(draw_devinfo->value() ? true : false); view_stats->set_visible(draw_stats->value() ? true : false); view_keypress->set_visible(draw_keypress->value() ? true : false); if (core::application()->connected() && core::game()->interactive()) { - if (client()->console()->visible() || chat()->visible()) { + if (client()->console()->visible()) { + view_notify->set_visible(false); + } else if (view_chat->visible() && !view_chat->small()) { view_notify->set_visible(false); } else { view_notify->set_visible(true); -- cgit v1.2.3