OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
mainmenu.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_GAME_MWGUI_MAINMENU_H
2 #define OPENMW_GAME_MWGUI_MAINMENU_H
3 
4 #include "windowbase.hpp"
5 
6 namespace Gui
7 {
8  class ImageButton;
9 }
10 
11 namespace VFS
12 {
13  class Manager;
14 }
15 
16 namespace MWGui
17 {
18 
19  class BackgroundImage;
20  class SaveGameDialog;
21  class VideoWidget;
22 
23  class MainMenu : public WindowBase
24  {
25  int mWidth;
26  int mHeight;
27 
29 
30  public:
31 
32  MainMenu(int w, int h, const VFS::Manager* vfs, const std::string& versionDescription);
33  ~MainMenu();
34 
35  void onResChange(int w, int h);
36 
37  virtual void setVisible (bool visible);
38 
39  void onFrame(float dt);
40 
41  bool exit();
42 
43  private:
45 
46  MyGUI::Widget* mButtonBox;
47  MyGUI::TextBox* mVersionText;
48 
50 
51  MyGUI::ImageBox* mVideoBackground;
52  VideoWidget* mVideo; // For animated main menus
53 
54  std::map<std::string, Gui::ImageButton*> mButtons;
55 
56  void onButtonClicked (MyGUI::Widget* sender);
57  void onNewGameConfirmed();
58  void onExitConfirmed();
59 
60  void showBackground(bool show);
61 
62  void updateMenu();
63 
65  };
66 
67 }
68 
69 #endif
void updateMenu()
Definition: mainmenu.cpp:218
void onNewGameConfirmed()
Definition: mainmenu.cpp:81
Definition: videowidget.hpp:22
Definition: mainmenu.hpp:23
void onFrame(float dt)
Called every frame if the window is in an active GUI mode.
Definition: mainmenu.cpp:201
bool mHasAnimatedMenu
Definition: mainmenu.hpp:28
const VFS::Manager * mVFS
Definition: mainmenu.hpp:44
VideoWidget * mVideo
Definition: mainmenu.hpp:52
void showBackground(bool show)
Definition: mainmenu.cpp:145
int mWidth
Definition: mainmenu.hpp:25
void onResChange(int w, int h)
Called when GUI viewport changes size.
Definition: mainmenu.cpp:46
void onButtonClicked(MyGUI::Widget *sender)
Definition: mainmenu.cpp:92
SaveGameDialog * mSaveGameDialog
Definition: mainmenu.hpp:64
MyGUI::TextBox * mVersionText
Definition: mainmenu.hpp:47
BackgroundImage * mBackground
Definition: mainmenu.hpp:49
std::map< std::string, Gui::ImageButton * > mButtons
Definition: mainmenu.hpp:54
void onExitConfirmed()
Definition: mainmenu.cpp:87
Definition: windowbase.hpp:21
MyGUI::ImageBox * mVideoBackground
Definition: mainmenu.hpp:51
Definition: savegamedialog.hpp:15
virtual void setVisible(bool visible)
Sets the visibility of the window.
Definition: mainmenu.cpp:54
~MainMenu()
Definition: mainmenu.cpp:41
MyGUI::Widget * mButtonBox
Definition: mainmenu.hpp:46
MainMenu(int w, int h, const VFS::Manager *vfs, const std::string &versionDescription)
Definition: mainmenu.cpp:24
The main class responsible for loading files from a virtual file system.
Definition: manager.hpp:20
int mHeight
Definition: mainmenu.hpp:26
A variant of MyGUI::ImageBox with aspect ratio correction using black bars.
Definition: backgroundimage.hpp:12
bool exit()
Gracefully exits the window.
Definition: mainmenu.cpp:213