Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2011-09-04 17:54:51 +0000
committerStijn Buys <ingar@osirion.org>2011-09-04 17:54:51 +0000
commit69eed715f80c24c2435c82bb9fa1954697bf3af0 (patch)
treea21aa14d2ecfa86b94d3b122c2c972d758425782 /src/client/mainwindow.cc
parentedd5dfcd15198f5d5d277835fdf75108eb67472d (diff)
Moved main menu infrastructure into client namespace,
removed ui::Container and ui::Menu classes.
Diffstat (limited to 'src/client/mainwindow.cc')
-rw-r--r--src/client/mainwindow.cc23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/client/mainwindow.cc b/src/client/mainwindow.cc
index 607e503..8e7b2af 100644
--- a/src/client/mainwindow.cc
+++ b/src/client/mainwindow.cc
@@ -79,6 +79,9 @@ void MainWindow::resize()
// resize game window
mainwindow_gamewindow->set_size(size());
+
+ // resize mainmenu window
+ mainwindow_mainmenu->set_size(size());
}
void MainWindow::clear()
@@ -114,14 +117,20 @@ void MainWindow::draw()
} else {
mainwindow_clockwidget->set_mode(ClockInfoWidget::Clock24Hours);
}
-
- // FIXME - either draw one of the menus or draw the playerview
- if (ui::root()->active() || !core::game()->interactive() || !core::localcontrol() || (core::localplayer()->view() && !core::localplayer()->view()->menus().size())) {
- if (mainwindow_gamewindow->visible())
- mainwindow_gamewindow->hide();
- } else {
- if (!mainwindow_gamewindow->visible())
+
+ if (!mainwindow_mainmenu->visible()) {
+
+ if (!core::game()->interactive() || !core::localcontrol()) {
+ mainwindow_mainmenu->show();
+
+ } else if (mainwindow_gamewindow->hidden()) {
mainwindow_gamewindow->show();
+ }
+
+ } else {
+ if (mainwindow_gamewindow->visible()) {
+ mainwindow_gamewindow->hide();
+ }
}
}