diff --git a/apps/openmw/mwgui/mainmenu.cpp b/apps/openmw/mwgui/mainmenu.cpp index e2fefd6497..7618ecb157 100644 --- a/apps/openmw/mwgui/mainmenu.cpp +++ b/apps/openmw/mwgui/mainmenu.cpp @@ -13,11 +13,20 @@ namespace MWGui MainMenu::MainMenu(int w, int h) : OEngine::GUI::Layout("openmw_mainmenu.layout") + , mButtonBox(0) + { + onResChange(w,h); + } + + void MainMenu::onResChange(int w, int h) { setCoord(0,0,w,h); int height = 64 * 3; + if (mButtonBox) + MyGUI::Gui::getInstance ().destroyWidget(mButtonBox); + mButtonBox = mMainWidget->createWidget("", MyGUI::IntCoord(w/2 - 64, h/2 - height/2, 128, height), MyGUI::Align::Default); int curH = 0; @@ -57,7 +66,6 @@ namespace MWGui mExitGame->setImageResource ("Menu_ExitGame"); mExitGame->eventMouseButtonClick += MyGUI::newDelegate(this, &MainMenu::exitGame); curH += 64; - } void MainMenu::returnToGame(MyGUI::Widget* sender) diff --git a/apps/openmw/mwgui/mainmenu.hpp b/apps/openmw/mwgui/mainmenu.hpp index 5fa2f69430..fd583d1876 100644 --- a/apps/openmw/mwgui/mainmenu.hpp +++ b/apps/openmw/mwgui/mainmenu.hpp @@ -8,6 +8,8 @@ namespace MWGui public: MainMenu(int w, int h); + void onResChange(int w, int h); + private: MyGUI::Button* mReturn; MyGUI::Button* mNewGame; diff --git a/apps/openmw/mwgui/window_manager.cpp b/apps/openmw/mwgui/window_manager.cpp index 659af04470..db7600da9f 100644 --- a/apps/openmw/mwgui/window_manager.cpp +++ b/apps/openmw/mwgui/window_manager.cpp @@ -639,6 +639,7 @@ void WindowManager::processChangedSettings(const Settings::CategorySettingVector int y = Settings::Manager::getInt("resolution y", "Video"); mHud->onResChange(x, y); mConsole->onResChange(x, y); + mMenu->onResChange(x, y); mSettingsWindow->center(); mAlchemyWindow->center(); mScrollWindow->center();