Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/mainmenu.cc')
-rw-r--r--src/client/mainmenu.cc53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/client/mainmenu.cc b/src/client/mainmenu.cc
new file mode 100644
index 0000000..5d1706d
--- /dev/null
+++ b/src/client/mainmenu.cc
@@ -0,0 +1,53 @@
+/*
+ client/mainmenu.cc
+ This file is part of the Osirion project and is distributed under
+ the terms and conditions of the GNU General Public License version 2
+*/
+
+#include "client/mainmenu.h"
+#include "ui/paint.h"
+
+namespace client
+{
+
+MainMenu::MainMenu(ui::Widget *parent) : ui::Window(parent)
+{
+ // default main menus
+ mainmenu_mainmenu = 0;
+ mainmenu_gamemenu = 0;
+ mainmenu_joinmenu = 0;
+
+ // default extra menus
+ mainmenu_optionsmenu = 0;
+ mainmenu_loadmenu = 0;
+ mainmenu_savemenu = 0;
+ mainmenu_connectmenu = 0;
+
+ set_background(true);
+ set_label("mainmenu");
+}
+
+MainMenu::~MainMenu()
+{
+}
+
+void MainMenu::show()
+{
+ ui::Widget::show();
+}
+
+void MainMenu::hide()
+{
+ ui::Widget::hide();
+}
+
+void MainMenu::draw_background()
+{
+ // we override draw_background instead of adding a ui::Bitmap child
+ // this simplifies child window managment
+ if (mainmenu_background.size()) {
+ ui::Paint::draw_bitmap(global_location(), size(), math::Color(), mainmenu_background);
+ }
+}
+
+} // namespace client