diff options
author | Stijn Buys <ingar@osirion.org> | 2008-10-19 17:16:39 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-10-19 17:16:39 +0000 |
commit | 8ccfd7747bddf3fad75b0f358a64e66646b54032 (patch) | |
tree | 8d666d7172fced1e310701741b860ed13f400a78 /src/client/view.cc | |
parent | 1d580ed36893b24b618ff1e6f9023e497c62498c (diff) |
ui_chat and ui_chatsmall
Diffstat (limited to 'src/client/view.cc')
-rw-r--r-- | src/client/view.cc | 20 |
1 files changed, 14 insertions, 6 deletions
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); |