diff --git a/apps/openmw/mwgui/class.cpp b/apps/openmw/mwgui/class.cpp index 88e553821..0ec07c650 100644 --- a/apps/openmw/mwgui/class.cpp +++ b/apps/openmw/mwgui/class.cpp @@ -291,8 +291,7 @@ void InfoBoxDialog::layoutVertically(MyGUI::WidgetPtr widget, int margin) } InfoBoxDialog::InfoBoxDialog(MWWorld::Environment& environment) - : Layout("openmw_infobox_layout.xml") - , environment(environment) + : WindowBase("openmw_infobox_layout.xml", environment) , currentButton(-1) { getWidget(textBox, "TextBox"); @@ -373,16 +372,6 @@ void InfoBoxDialog::onButtonClicked(MyGUI::WidgetPtr _sender) } } -void InfoBoxDialog::center() -{ - // Centre dialog - MyGUI::IntSize gameWindowSize = environment.mWindowManager->getGui()->getViewSize(); - MyGUI::IntCoord coord = mMainWidget->getCoord(); - coord.left = (gameWindowSize.width - coord.width)/2; - coord.top = (gameWindowSize.height - coord.height)/2; - mMainWidget->setCoord(coord); -} - /* ClassChoiceDialog */ ClassChoiceDialog::ClassChoiceDialog(MWWorld::Environment& environment) diff --git a/apps/openmw/mwgui/class.hpp b/apps/openmw/mwgui/class.hpp index bd7a785a4..816152e3a 100644 --- a/apps/openmw/mwgui/class.hpp +++ b/apps/openmw/mwgui/class.hpp @@ -8,6 +8,7 @@ #include #include "widgets.hpp" +#include "window_base.hpp" namespace MWWorld { @@ -23,7 +24,7 @@ namespace MWGui { using namespace MyGUI; - class InfoBoxDialog : public OEngine::GUI::Layout + class InfoBoxDialog : public WindowBase { public: InfoBoxDialog(MWWorld::Environment& environment); @@ -49,9 +50,6 @@ namespace MWGui void onButtonClicked(MyGUI::WidgetPtr _sender); private: - void center(); - - MWWorld::Environment& environment; void fitToText(MyGUI::StaticTextPtr widget); void layoutVertically(MyGUI::WidgetPtr widget, int margin);