Make RaceDialog use the new WindowBase

This commit is contained in:
Jan-Peter Nilsson 2010-11-06 11:26:45 +01:00
parent 933af72d60
commit e551c60e75
2 changed files with 4 additions and 11 deletions

View file

@ -16,8 +16,7 @@ using namespace MWGui;
using namespace Widgets; using namespace Widgets;
RaceDialog::RaceDialog(MWWorld::Environment& environment) RaceDialog::RaceDialog(MWWorld::Environment& environment)
: Layout("openmw_chargen_race_layout.xml") : WindowBase("openmw_chargen_race_layout.xml", environment)
, environment(environment)
, genderIndex(0) , genderIndex(0)
, faceIndex(0) , faceIndex(0)
, hairIndex(0) , hairIndex(0)
@ -25,11 +24,7 @@ RaceDialog::RaceDialog(MWWorld::Environment& environment)
, hairCount(14) , hairCount(14)
{ {
// Centre dialog // Centre dialog
MyGUI::IntSize gameWindowSize = environment.mWindowManager->getGui()->getViewSize(); center();
MyGUI::IntCoord coord = mMainWidget->getCoord();
coord.left = (gameWindowSize.width - coord.width)/2;
coord.top = (gameWindowSize.height - coord.height)/2;
mMainWidget->setCoord(coord);
// These are just demo values, you should replace these with // These are just demo values, you should replace these with
// real calls from outside the class later. // real calls from outside the class later.

View file

@ -3,7 +3,7 @@
#include <components/esm_store/store.hpp> #include <components/esm_store/store.hpp>
#include <openengine/gui/layout.hpp> #include "window_base.hpp"
#include <boost/array.hpp> #include <boost/array.hpp>
@ -21,7 +21,7 @@ namespace MWGui
{ {
using namespace MyGUI; using namespace MyGUI;
class RaceDialog : public OEngine::GUI::Layout class RaceDialog : public WindowBase
{ {
public: public:
RaceDialog(MWWorld::Environment& environment); RaceDialog(MWWorld::Environment& environment);
@ -80,8 +80,6 @@ namespace MWGui
void updateSkills(); void updateSkills();
void updateSpellPowers(); void updateSpellPowers();
MWWorld::Environment& environment;
MyGUI::CanvasPtr appearanceBox; MyGUI::CanvasPtr appearanceBox;
MyGUI::ListPtr raceList; MyGUI::ListPtr raceList;
MyGUI::HScrollPtr headRotate; MyGUI::HScrollPtr headRotate;