diff options
author | Stijn Buys <ingar@osirion.org> | 2008-10-19 16:03:56 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-10-19 16:03:56 +0000 |
commit | 1d580ed36893b24b618ff1e6f9023e497c62498c (patch) | |
tree | ac942e5fd15811c6ea2fa449f88f5c4cc4187d30 /src/client/view.cc | |
parent | 56cdfd3822d2800abdd2f912ab7f76a5764793a7 (diff) |
on-screen notifications
Diffstat (limited to 'src/client/view.cc')
-rw-r--r-- | src/client/view.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/client/view.cc b/src/client/view.cc index a5da7d4..771f63a 100644 --- a/src/client/view.cc +++ b/src/client/view.cc @@ -197,7 +197,7 @@ View::View(ui::Widget *parent) : ui::Widget(parent) view_devinfo = new DevInfo(this); view_stats = new Stats(this); view_keypress = new KeyPress(this); - + view_notify = new Notifications(this); view_chat = new Chat(this); // make sure the view is at the bottom of the draw stack @@ -216,6 +216,10 @@ void View::resize() 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_size(width() - font()->width() * 2, height() * 0.5f - view_notify->top()); + // reposition stats widget view_stats->set_size(font()->width()*12, font()->height()*5); view_stats->set_location(width() - view_stats->width() - font()->width() * 0.5, font()->height() * 0.5f); @@ -237,6 +241,16 @@ void View::draw() 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()) { + view_notify->set_visible(false); + } else { + view_notify->set_visible(true); + } + } else { + view_notify->set_visible(false); + } + if (core::localcontrol() && (input::mouse_control || input::joystick_control) && (render::Camera::mode() == render::Camera::Cockpit || render::Camera::mode() == render::Camera::Track)) { view_center->set_visible(true); |