1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-01 00:32:52 +00:00
OpenMW/apps/openmw/mwgui/mainmenu.hpp

70 lines
1.3 KiB
C++
Raw Normal View History

#ifndef OPENMW_GAME_MWGUI_MAINMENU_H
#define OPENMW_GAME_MWGUI_MAINMENU_H
2022-08-31 19:05:32 +02:00
#include <memory>
#include "savegamedialog.hpp"
#include "windowbase.hpp"
namespace Gui
{
class ImageButton;
}
2015-05-02 18:14:53 +02:00
namespace VFS
{
class Manager;
}
namespace MWGui
{
class BackgroundImage;
class VideoWidget;
class MainMenu : public WindowBase
{
2022-09-22 21:26:05 +03:00
int mWidth;
int mHeight;
2022-09-22 21:26:05 +03:00
bool mHasAnimatedMenu;
2022-09-22 21:26:05 +03:00
public:
MainMenu(int w, int h, const VFS::Manager* vfs, const std::string& versionDescription);
2022-09-22 21:26:05 +03:00
void onResChange(int w, int h) override;
2022-09-22 21:26:05 +03:00
void setVisible(bool visible) override;
2022-09-22 21:26:05 +03:00
void onFrame(float dt) override;
2022-09-22 21:26:05 +03:00
bool exit() override;
2022-09-22 21:26:05 +03:00
private:
const VFS::Manager* mVFS;
2022-09-22 21:26:05 +03:00
MyGUI::Widget* mButtonBox;
MyGUI::TextBox* mVersionText;
2022-09-22 21:26:05 +03:00
BackgroundImage* mBackground;
2022-09-22 21:26:05 +03:00
MyGUI::ImageBox* mVideoBackground;
VideoWidget* mVideo; // For animated main menus
2022-09-22 21:26:05 +03:00
std::map<std::string, Gui::ImageButton*> mButtons;
2022-09-22 21:26:05 +03:00
void onButtonClicked(MyGUI::Widget* sender);
void onNewGameConfirmed();
void onExitConfirmed();
2022-09-22 21:26:05 +03:00
void showBackground(bool show);
2022-09-22 21:26:05 +03:00
void updateMenu();
2022-09-22 21:26:05 +03:00
std::unique_ptr<SaveGameDialog> mSaveGameDialog;
};
}
#endif