diff options
author | Stijn Buys <ingar@osirion.org> | 2010-12-08 20:19:21 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2010-12-08 20:19:21 +0000 |
commit | 82992a9b16d64104dd28d42e97cc118a75fded86 (patch) | |
tree | a7c30cedd613196c06df3fc04f6bce015c3927c1 /src/client/worldview.cc | |
parent | 1124a81de517375a012b89bf83462c091d472cab (diff) |
Added clock.
Diffstat (limited to 'src/client/worldview.cc')
-rw-r--r-- | src/client/worldview.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/client/worldview.cc b/src/client/worldview.cc index 35cada2..56ba77e 100644 --- a/src/client/worldview.cc +++ b/src/client/worldview.cc @@ -23,6 +23,7 @@ WorldView::WorldView(ui::Widget *parent) : ui::Widget(parent) view_devinfo = new DevInfoWidget(this); view_statsinfo = new StatsInfoWidget(this); view_keyinfo = new KeyInfoWidget(this); + view_clock = new ClockInfoWidget(this); view_playerview = new PlayerView(this); view_playerview->raise(); @@ -51,6 +52,10 @@ void WorldView::resize() // reposition stats widget view_statsinfo->set_size(font()->width()*12, font()->height()*5); view_statsinfo->set_location(width() - view_statsinfo->width() - smallmargin, smallmargin); + + // reposition clock + view_clock->set_size(font()->width()*7, font()->height()); + view_clock->set_location(width() - view_clock->width() - smallmargin, view_statsinfo->bottom() + smallmargin); // reposition keypress widget view_keyinfo->set_size(font()->width()*12, font()->height()*1); @@ -72,10 +77,17 @@ void WorldView::draw() { // worldview is only drawn when the application is connected // and the loader screen is not shown - view_devinfo->set_visible(draw_devinfo->value() ? true : false); view_statsinfo->set_visible(draw_stats->value() ? true : false); view_keyinfo->set_visible(draw_keypress->value() ? true : false); + if (draw_clock->value() <= 0) { + view_clock->set_mode(ClockInfoWidget::ClockOff); + } else if (draw_clock->value() >= 2) { + view_clock->set_mode(ClockInfoWidget::Clock12Hours); + } else { + view_clock->set_mode(ClockInfoWidget::Clock24Hours); + } + if (ui::root()->active() || !core::game()->interactive() || !core::localcontrol() || (core::localplayer()->view() && !core::localplayer()->view()->menus().size())) { view_playerview->hide(); |