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;
RaceDialog::RaceDialog(MWWorld::Environment& environment)
: Layout("openmw_chargen_race_layout.xml")
, environment(environment)
: WindowBase("openmw_chargen_race_layout.xml", environment)
, genderIndex(0)
, faceIndex(0)
, hairIndex(0)
@ -25,11 +24,7 @@ RaceDialog::RaceDialog(MWWorld::Environment& environment)
, hairCount(14)
{
// 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);
center();
// These are just demo values, you should replace these with
// real calls from outside the class later.

View file

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