Esempio n. 1
0
SelectSpecializationDialog::SelectSpecializationDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize)
  : WindowBase("openmw_chargen_select_specialization_layout.xml", environment)
{
    // Centre dialog
    center();

    WindowManager *wm = environment.mWindowManager;

    setText("LabelT", wm->getGameSettingString("sSpecializationMenu1", ""));

    getWidget(specialization0, "Specialization0");
    getWidget(specialization1, "Specialization1");
    getWidget(specialization2, "Specialization2");
    specialization0->setCaption(wm->getGameSettingString(ESM::Class::gmstSpecializationIds[ESM::Class::Combat], ""));
    specialization0->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
    specialization1->setCaption(wm->getGameSettingString(ESM::Class::gmstSpecializationIds[ESM::Class::Magic], ""));
    specialization1->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
    specialization2->setCaption(wm->getGameSettingString(ESM::Class::gmstSpecializationIds[ESM::Class::Stealth], ""));
    specialization2->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
    specializationId = ESM::Class::Combat;

    // TODO: These buttons should be managed by a Dialog class
    MyGUI::ButtonPtr cancelButton;
    getWidget(cancelButton, "CancelButton");
    cancelButton->setCaption(wm->getGameSettingString("sCancel", ""));
    cancelButton->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectSpecializationDialog::onCancelClicked);
}
Esempio n. 2
0
SelectSpecializationDialog::SelectSpecializationDialog(MWBase::WindowManager& parWindowManager)
  : WindowModal("openmw_chargen_select_specialization.layout", parWindowManager)
{
    // Centre dialog
    center();

    setText("LabelT", mWindowManager.getGameSettingString("sSpecializationMenu1", ""));

    getWidget(mSpecialization0, "Specialization0");
    getWidget(mSpecialization1, "Specialization1");
    getWidget(mSpecialization2, "Specialization2");
    std::string combat = mWindowManager.getGameSettingString(ESM::Class::sGmstSpecializationIds[ESM::Class::Combat], "");
    std::string magic = mWindowManager.getGameSettingString(ESM::Class::sGmstSpecializationIds[ESM::Class::Magic], "");
    std::string stealth = mWindowManager.getGameSettingString(ESM::Class::sGmstSpecializationIds[ESM::Class::Stealth], "");

    mSpecialization0->setCaption(combat);
    mSpecialization0->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
    mSpecialization1->setCaption(magic);
    mSpecialization1->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
    mSpecialization2->setCaption(stealth);
    mSpecialization2->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
    mSpecializationId = ESM::Class::Combat;

    ToolTips::createSpecializationToolTip(mSpecialization0, combat, ESM::Class::Combat);
    ToolTips::createSpecializationToolTip(mSpecialization1, magic, ESM::Class::Magic);
    ToolTips::createSpecializationToolTip(mSpecialization2, stealth, ESM::Class::Stealth);

    MyGUI::ButtonPtr cancelButton;
    getWidget(cancelButton, "CancelButton");
    cancelButton->setCaption(mWindowManager.getGameSettingString("sCancel", ""));
    cancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSpecializationDialog::onCancelClicked);
}
Esempio n. 3
0
BirthDialog::BirthDialog(MWBase::WindowManager& parWindowManager)
  : WindowBase("openmw_chargen_birth.layout", parWindowManager)
{
    // Centre dialog
    center();

    getWidget(mSpellArea, "SpellArea");

    getWidget(mBirthImage, "BirthsignImage");

    getWidget(mBirthList, "BirthsignList");
    mBirthList->setScrollVisible(true);
    mBirthList->eventListSelectAccept += MyGUI::newDelegate(this, &BirthDialog::onSelectBirth);
    mBirthList->eventListMouseItemActivate += MyGUI::newDelegate(this, &BirthDialog::onSelectBirth);
    mBirthList->eventListChangePosition += MyGUI::newDelegate(this, &BirthDialog::onSelectBirth);

    MyGUI::ButtonPtr backButton;
    getWidget(backButton, "BackButton");
    backButton->eventMouseButtonClick += MyGUI::newDelegate(this, &BirthDialog::onBackClicked);

    MyGUI::ButtonPtr okButton;
    getWidget(okButton, "OKButton");
    okButton->setCaption(mWindowManager.getGameSettingString("sOK", ""));
    okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &BirthDialog::onOkClicked);
    okButton->setEnabled(false);

    updateBirths();
    updateSpells();
}
Esempio n. 4
0
void InfoBoxDialog::setButtons(ButtonList &buttons)
{
    for (std::vector<MyGUI::ButtonPtr>::iterator it = this->mButtons.begin(); it != this->mButtons.end(); ++it)
    {
        MyGUI::Gui::getInstance().destroyWidget(*it);
    }
    this->mButtons.clear();
    mCurrentButton = -1;

    // TODO: The buttons should be generated from a template in the layout file, ie. cloning an existing widget
    MyGUI::ButtonPtr button;
    MyGUI::IntCoord coord = MyGUI::IntCoord(0, 0, mButtonBar->getWidth(), 10);
    ButtonList::const_iterator end = buttons.end();
    for (ButtonList::const_iterator it = buttons.begin(); it != end; ++it)
    {
        const std::string &text = *it;
        button = mButtonBar->createWidget<MyGUI::Button>("MW_Button", coord, MyGUI::Align::Top | MyGUI::Align::HCenter, "");
        button->getSubWidgetText()->setWordWrap(true);
        button->setCaption(text);
        fitToText(button);
        button->eventMouseButtonClick += MyGUI::newDelegate(this, &InfoBoxDialog::onButtonClicked);
        coord.top += button->getHeight();
        this->mButtons.push_back(button);
    }
}
Esempio n. 5
0
SelectAttributeDialog::SelectAttributeDialog(WindowManager& parWindowManager)
  : WindowBase("openmw_chargen_select_attribute.layout", parWindowManager)
{
    // Centre dialog
    center();

    setText("LabelT", mWindowManager.getGameSettingString("sAttributesMenu1", ""));

    for (int i = 0; i < 8; ++i)
    {
        Widgets::MWAttributePtr attribute;
        char theIndex = '0'+i;

        getWidget(attribute,  std::string("Attribute").append(1, theIndex));
        attribute->setWindowManager(&parWindowManager);
        attribute->setAttributeId(ESM::Attribute::attributeIds[i]);
        attribute->eventClicked += MyGUI::newDelegate(this, &SelectAttributeDialog::onAttributeClicked);
        ToolTips::createAttributeToolTip(attribute, attribute->getAttributeId());
    }

    MyGUI::ButtonPtr cancelButton;
    getWidget(cancelButton, "CancelButton");
    cancelButton->setCaption(mWindowManager.getGameSettingString("sCancel", ""));
    cancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectAttributeDialog::onCancelClicked);
    int buttonWidth = cancelButton->getTextSize().width + 24;
    cancelButton->setCoord(186 - buttonWidth, 180, buttonWidth, 21);

    MyGUI::InputManager::getInstance().addWidgetModal(mMainWidget);
}
Esempio n. 6
0
SelectAttributeDialog::SelectAttributeDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize)
  : WindowBase("openmw_chargen_select_attribute_layout.xml", environment)
{
    // Centre dialog
    center();

    WindowManager *wm = environment.mWindowManager;

    setText("LabelT", wm->getGameSettingString("sAttributesMenu1", ""));

    for (int i = 0; i < 8; ++i)
    {
        Widgets::MWAttributePtr attribute;
        char theIndex = '0'+i;

        getWidget(attribute,  std::string("Attribute").append(1, theIndex));
        attribute->setWindowManager(wm);
        attribute->setAttributeId(ESM::Attribute::attributeIds[i]);
        attribute->eventClicked = MyGUI::newDelegate(this, &SelectAttributeDialog::onAttributeClicked);
    }

    // TODO: These buttons should be managed by a Dialog class
    MyGUI::ButtonPtr cancelButton;
    getWidget(cancelButton, "CancelButton");
    cancelButton->setCaption(wm->getGameSettingString("sCancel", ""));
    cancelButton->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectAttributeDialog::onCancelClicked);
}
Esempio n. 7
0
void PanelObjectsList::AddItem(Ogre::UTFString name)
{		
		MyGUI::ButtonPtr checkbox = mWidgetClient->createWidget<MyGUI::Button>("CheckBox", MyGUI::IntCoord(WidthStep, CurrentHeight, Width, Height), MyGUI::Align::Left | MyGUI::Align::Top | MyGUI::Align::HStretch);		
		checkbox->setCaption(name);		
		checkbox->eventMouseButtonClick = MyGUI::newDelegate(this, &PanelObjectsList::mousePressed);
		mItemsCheckBox.push_back(checkbox);
		
		UpdateItemsView();
}
Esempio n. 8
0
void BirthDialog::setNextButtonShow(bool shown)
{
    MyGUI::ButtonPtr okButton;
    getWidget(okButton, "OKButton");

    if (shown)
        okButton->setCaption(mWindowManager.getGameSettingString("sNext", ""));
    else
        okButton->setCaption(mWindowManager.getGameSettingString("sOK", ""));
}
Esempio n. 9
0
void BirthDialog::onSelectBirth(MyGUI::ListBox* _sender, size_t _index)
{
    if (_index == MyGUI::ITEM_NONE)
        return;

    MyGUI::ButtonPtr okButton;
    getWidget(okButton, "OKButton");
    okButton->setEnabled(true);

    const std::string *birthId = mBirthList->getItemDataAt<std::string>(_index);
    if (boost::iequals(mCurrentBirthId, *birthId))
        return;

    mCurrentBirthId = *birthId;
    updateSpells();
}
Esempio n. 10
0
DescriptionDialog::DescriptionDialog(MWBase::WindowManager& parWindowManager)
  : WindowModal("openmw_chargen_class_description.layout", parWindowManager)
{
    // Centre dialog
    center();

    getWidget(mTextEdit, "TextEdit");

    MyGUI::ButtonPtr okButton;
    getWidget(okButton, "OKButton");
    okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &DescriptionDialog::onOkClicked);
    okButton->setCaption(mWindowManager.getGameSettingString("sInputMenu1", ""));

    // Make sure the edit box has focus
    MyGUI::InputManager::getInstance().setKeyFocusWidget(mTextEdit);
}
Esempio n. 11
0
void PickClassDialog::onSelectClass(MyGUI::ListBox* _sender, size_t _index)
{
    if (_index == MyGUI::ITEM_NONE)
        return;

    MyGUI::ButtonPtr okButton;
    getWidget(okButton, "OKButton");
    okButton->setTextColour(MyGUI::Colour(0.75f, 0.6f, 0.35f));

    const std::string *classId = mClassList->getItemDataAt<std::string>(_index);
    if (boost::iequals(mCurrentClassId, *classId))
        return;

    mCurrentClassId = *classId;
    updateStats();
}
Esempio n. 12
0
DescriptionDialog::DescriptionDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize)
  : WindowBase("openmw_chargen_class_description_layout.xml", environment)
{
    // Centre dialog
    center();

    getWidget(textEdit, "TextEdit");

    // TODO: These buttons should be managed by a Dialog class
    MyGUI::ButtonPtr okButton;
    getWidget(okButton, "OKButton");
    okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &DescriptionDialog::onOkClicked);
    okButton->setCaption(environment.mWindowManager->getGameSettingString("sInputMenu1", ""));

    // Make sure the edit box has focus
    MyGUI::InputManager::getInstance().setKeyFocusWidget(textEdit);
}
Esempio n. 13
0
GenerateClassResultDialog::GenerateClassResultDialog(WindowManager& parWindowManager)
  : WindowBase("openmw_chargen_generate_class_result.layout", parWindowManager)
{
    // Centre dialog
    center();

    setText("ReflectT", mWindowManager.getGameSettingString("sMessageQuestionAnswer1", ""));

    getWidget(mClassImage, "ClassImage");
    getWidget(mClassName, "ClassName");

    MyGUI::ButtonPtr backButton;
    getWidget(backButton, "BackButton");
    backButton->eventMouseButtonClick += MyGUI::newDelegate(this, &GenerateClassResultDialog::onBackClicked);

    MyGUI::ButtonPtr okButton;
    getWidget(okButton, "OKButton");
    okButton->setCaption(mWindowManager.getGameSettingString("sOK", ""));
    okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &GenerateClassResultDialog::onOkClicked);

    int okButtonWidth = okButton->getTextSize().width + 24;
    int backButtonWidth = backButton->getTextSize().width + 24;
    okButton->setCoord(315 - okButtonWidth, 219, okButtonWidth, 23);
    backButton->setCoord(315 - okButtonWidth - backButtonWidth - 6, 219, backButtonWidth, 23);
}
Esempio n. 14
0
void PickClassDialog::setClassId(const std::string &classId)
{
    mCurrentClassId = classId;
    mClassList->setIndexSelected(MyGUI::ITEM_NONE);
    size_t count = mClassList->getItemCount();
    for (size_t i = 0; i < count; ++i)
    {
        if (boost::iequals(*mClassList->getItemDataAt<std::string>(i), classId))
        {
            mClassList->setIndexSelected(i);
            MyGUI::ButtonPtr okButton;
            getWidget(okButton, "OKButton");
            okButton->setTextColour(MyGUI::Colour(0.75f, 0.6f, 0.35f));
            break;
        }
    }

    updateStats();
}
Esempio n. 15
0
void BirthDialog::setBirthId(const std::string &birthId)
{
    mCurrentBirthId = birthId;
    mBirthList->setIndexSelected(MyGUI::ITEM_NONE);
    size_t count = mBirthList->getItemCount();
    for (size_t i = 0; i < count; ++i)
    {
        if (boost::iequals(*mBirthList->getItemDataAt<std::string>(i), birthId))
        {
            mBirthList->setIndexSelected(i);
            MyGUI::ButtonPtr okButton;
            getWidget(okButton, "OKButton");
            okButton->setEnabled(true);
            break;
        }
    }

    updateSpells();
}
Esempio n. 16
0
PickClassDialog::PickClassDialog(MWBase::WindowManager& parWindowManager)
  : WindowBase("openmw_chargen_class.layout", parWindowManager)
{
    // Centre dialog
    center();

    getWidget(mSpecializationName, "SpecializationName");

    getWidget(mFavoriteAttribute[0], "FavoriteAttribute0");
    getWidget(mFavoriteAttribute[1], "FavoriteAttribute1");
    mFavoriteAttribute[0]->setWindowManager(&mWindowManager);
    mFavoriteAttribute[1]->setWindowManager(&mWindowManager);

    for(int i = 0; i < 5; i++)
    {
        char theIndex = '0'+i;
        getWidget(mMajorSkill[i], std::string("MajorSkill").append(1, theIndex));
        getWidget(mMinorSkill[i], std::string("MinorSkill").append(1, theIndex));
        mMajorSkill[i]->setWindowManager(&mWindowManager);
        mMinorSkill[i]->setWindowManager(&mWindowManager);
    }

    getWidget(mClassList, "ClassList");
    mClassList->setScrollVisible(true);
    mClassList->eventListSelectAccept += MyGUI::newDelegate(this, &PickClassDialog::onSelectClass);
    mClassList->eventListMouseItemActivate += MyGUI::newDelegate(this, &PickClassDialog::onSelectClass);
    mClassList->eventListChangePosition += MyGUI::newDelegate(this, &PickClassDialog::onSelectClass);

    getWidget(mClassImage, "ClassImage");

    MyGUI::ButtonPtr backButton;
    getWidget(backButton, "BackButton");
    backButton->eventMouseButtonClick += MyGUI::newDelegate(this, &PickClassDialog::onBackClicked);

    MyGUI::ButtonPtr okButton;
    getWidget(okButton, "OKButton");
    okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &PickClassDialog::onOkClicked);
    okButton->setTextColour(MyGUI::Colour(0.6f, 0.56f, 0.45f));

    updateClasses();
    updateStats();
}
Esempio n. 17
0
void RaceDialog::onSelectRace(MyGUI::ListBox* _sender, size_t _index)
{
    if (_index == MyGUI::ITEM_NONE)
        return;

    MyGUI::ButtonPtr okButton;
    getWidget(okButton, "OKButton");
    okButton->setEnabled(true);
    const std::string *raceId = mRaceList->getItemDataAt<std::string>(_index);
    if (boost::iequals(mCurrentRaceId, *raceId))
        return;

    mCurrentRaceId = *raceId;

    recountParts();

    updatePreview();
    updateSkills();
    updateSpellPowers();
}
Esempio n. 18
0
void GraphicsImpl::setupGUI()
{
	MyGUI::Gui * mGUI;
	MyGUI::OgrePlatform* platform = new MyGUI::OgrePlatform();
	platform->initialise(window, sceneMgr);
	gui = new MyGUI::Gui();
	gui->initialise();

	mainGuiWidget = gui->createWidgetReal<MyGUI::Widget>("Default", 0.0, 0.0, 1.0, 1.0, MyGUI::Align::Default, "Main");

	MyGUI::ButtonPtr button = mainGuiWidget->createWidgetReal<MyGUI::Button>("Button", 0.005, 0.008, 0.156, 0.05, MyGUI::Align::Default, "exit");
	button->setCaption("exit");
	// set callback
	button->eventMouseButtonClick = MyGUI::newDelegate(this, &GraphicsImpl::guiCallback);

	button = mainGuiWidget->createWidgetReal<MyGUI::Button>("Button", 0.182, 0.008, 0.156, 0.05, MyGUI::Align::Default, "do");
	button->setCaption("do something");
	// set callback
	button->eventMouseButtonClick = MyGUI::newDelegate(this, &GraphicsImpl::guiCallback);
}
Esempio n. 19
0
void RaceDialog::setRaceId(const std::string &raceId)
{
    mCurrentRaceId = raceId;
    mRaceList->setIndexSelected(MyGUI::ITEM_NONE);
    size_t count = mRaceList->getItemCount();
    for (size_t i = 0; i < count; ++i)
    {
        if (boost::iequals(*mRaceList->getItemDataAt<std::string>(i), raceId))
        {
            mRaceList->setIndexSelected(i);
            MyGUI::ButtonPtr okButton;
            getWidget(okButton, "OKButton");
            okButton->setEnabled(true);
            break;
        }
    }

    updateSkills();
    updateSpellPowers();
}
Esempio n. 20
0
void StatePanel::notifyMouseButtonClick(MyGUI::Widget* _sender)
{
	MyGUI::ButtonPtr btn = static_cast<MyGUI::ButtonPtr>(_sender);

	std::string btnName = btn->getName();
	btnName = btnName.substr(mPrefix.length(),btnName.length() - mPrefix.length());
	
	bool ret = false;

	if (btnName == "BT_ADD_ACTOR")
		loadActor("",ret);
	else if (btnName == "BT_ADD_MOTION")
		loadMotion("",ret);
	else if (btnName == "BT_REMOVE_MOTION")
		removeMotion("",ret);
	else if (btnName == "BT_REMOVE_ACTOR")
		removeActor("", ret);
	else if(btnName == "BT_ADD_ANIMATION")
		createAnimation("", ret);
	else if(btnName == "BT_REMOVE_ANIMATION") 
		removeAnimation("", ret);
}
Esempio n. 21
0
void PickClassDialog::setNextButtonShow(bool shown)
{
    MyGUI::ButtonPtr backButton;
    getWidget(backButton, "BackButton");

    MyGUI::ButtonPtr okButton;
    getWidget(okButton, "OKButton");

    if (shown)
        okButton->setCaption(mWindowManager.getGameSettingString("sNext", ""));
    else
        okButton->setCaption(mWindowManager.getGameSettingString("sOK", ""));

    int okButtonWidth = okButton->getTextSize().width + 24;
    int backButtonWidth = backButton->getTextSize().width + 24;

    okButton->setCoord(476 - okButtonWidth, 265, okButtonWidth, 23);
    backButton->setCoord(476 - okButtonWidth - backButtonWidth - 6, 265, backButtonWidth, 23);
}
Esempio n. 22
0
void PickClassDialog::setNextButtonShow(bool shown)
{
    MyGUI::ButtonPtr backButton;
    getWidget(backButton, "BackButton");

    MyGUI::ButtonPtr okButton;
    getWidget(okButton, "OKButton");

    // TODO: All hardcoded coords for buttons are temporary, will be replaced with a dynamic system.
    if (shown)
    {
        okButton->setCaption("Next");

        // Adjust back button when next is shown
        backButton->setCoord(MyGUI::IntCoord(382 - 18, 265, 53, 23));
        okButton->setCoord(MyGUI::IntCoord(434 - 18, 265, 42 + 18, 23));
    }
    else
    {
        okButton->setCaption("OK");
        backButton->setCoord(MyGUI::IntCoord(382, 265, 53, 23));
        okButton->setCoord(MyGUI::IntCoord(434, 265, 42, 23));
    }
}
Esempio n. 23
0
SelectSkillDialog::SelectSkillDialog(WindowManager& parWindowManager)
  : WindowBase("openmw_chargen_select_skill.layout", parWindowManager)
{
    // Centre dialog
    center();

    setText("LabelT", mWindowManager.getGameSettingString("sSkillsMenu1", ""));
    setText("CombatLabelT", mWindowManager.getGameSettingString("sSpecializationCombat", ""));
    setText("MagicLabelT", mWindowManager.getGameSettingString("sSpecializationMagic", ""));
    setText("StealthLabelT", mWindowManager.getGameSettingString("sSpecializationStealth", ""));

    for(int i = 0; i < 9; i++)
    {
        char theIndex = '0'+i;
        getWidget(mCombatSkill[i],  std::string("CombatSkill").append(1, theIndex));
        getWidget(mMagicSkill[i],   std::string("MagicSkill").append(1, theIndex));
        getWidget(mStealthSkill[i], std::string("StealthSkill").append(1, theIndex));
    }

    struct {Widgets::MWSkillPtr widget; ESM::Skill::SkillEnum skillId;} mSkills[3][9] = {
        {
            {mCombatSkill[0], ESM::Skill::Block},
            {mCombatSkill[1], ESM::Skill::Armorer},
            {mCombatSkill[2], ESM::Skill::MediumArmor},
            {mCombatSkill[3], ESM::Skill::HeavyArmor},
            {mCombatSkill[4], ESM::Skill::BluntWeapon},
            {mCombatSkill[5], ESM::Skill::LongBlade},
            {mCombatSkill[6], ESM::Skill::Axe},
            {mCombatSkill[7], ESM::Skill::Spear},
            {mCombatSkill[8], ESM::Skill::Athletics}
        },
        {
            {mMagicSkill[0], ESM::Skill::Enchant},
            {mMagicSkill[1], ESM::Skill::Destruction},
            {mMagicSkill[2], ESM::Skill::Alteration},
            {mMagicSkill[3], ESM::Skill::Illusion},
            {mMagicSkill[4], ESM::Skill::Conjuration},
            {mMagicSkill[5], ESM::Skill::Mysticism},
            {mMagicSkill[6], ESM::Skill::Restoration},
            {mMagicSkill[7], ESM::Skill::Alchemy},
            {mMagicSkill[8], ESM::Skill::Unarmored}
        },
        {
            {mStealthSkill[0], ESM::Skill::Security},
            {mStealthSkill[1], ESM::Skill::Sneak},
            {mStealthSkill[2], ESM::Skill::Acrobatics},
            {mStealthSkill[3], ESM::Skill::LightArmor},
            {mStealthSkill[4], ESM::Skill::ShortBlade},
            {mStealthSkill[5] ,ESM::Skill::Marksman},
            {mStealthSkill[6] ,ESM::Skill::Mercantile},
            {mStealthSkill[7] ,ESM::Skill::Speechcraft},
            {mStealthSkill[8] ,ESM::Skill::HandToHand}
        }
    };

    for (int spec = 0; spec < 3; ++spec)
    {
        for (int i = 0; i < 9; ++i)
        {
            mSkills[spec][i].widget->setWindowManager(&mWindowManager);
            mSkills[spec][i].widget->setSkillId(mSkills[spec][i].skillId);
            mSkills[spec][i].widget->eventClicked += MyGUI::newDelegate(this, &SelectSkillDialog::onSkillClicked);
            ToolTips::createSkillToolTip(mSkills[spec][i].widget, mSkills[spec][i].widget->getSkillId());
        }
    }

    MyGUI::ButtonPtr cancelButton;
    getWidget(cancelButton, "CancelButton");
    cancelButton->setCaption(mWindowManager.getGameSettingString("sCancel", ""));
    cancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSkillDialog::onCancelClicked);
    int buttonWidth = cancelButton->getTextSize().width + 24;
    cancelButton->setCoord(447 - buttonWidth, 218, buttonWidth, 21);

    MyGUI::InputManager::getInstance().addWidgetModal(mMainWidget);
}
Esempio n. 24
0
void CreateClassDialog::setNextButtonShow(bool shown)
{
    MyGUI::ButtonPtr backButton;
    getWidget(backButton, "BackButton");

    MyGUI::ButtonPtr okButton;
    getWidget(okButton, "OKButton");

    MyGUI::ButtonPtr descriptionButton;
    getWidget(descriptionButton, "DescriptionButton");

    if (shown)
        okButton->setCaption(mWindowManager.getGameSettingString("sNext", ""));
    else
        okButton->setCaption(mWindowManager.getGameSettingString("sOK", ""));

    int okButtonWidth = okButton->getTextSize().width + 24;
    int backButtonWidth = backButton->getTextSize().width + 24;
    int descriptionButtonWidth = descriptionButton->getTextSize().width + 24;

    okButton->setCoord(459 - okButtonWidth, 158, okButtonWidth, 23);
    backButton->setCoord(459 - okButtonWidth - backButtonWidth - 6, 158, backButtonWidth, 23);
    descriptionButton->setCoord(459 - okButtonWidth - backButtonWidth - descriptionButtonWidth - 12, 158, descriptionButtonWidth, 23);
}
Esempio n. 25
0
CreateClassDialog::CreateClassDialog(WindowManager& parWindowManager)
  : WindowBase("openmw_chargen_create_class.layout", parWindowManager)
  , mSpecDialog(nullptr)
  , mAttribDialog(nullptr)
  , mSkillDialog(nullptr)
  , mDescDialog(nullptr)
{
    // Centre dialog
    center();

    setText("SpecializationT", mWindowManager.getGameSettingString("sChooseClassMenu1", "Specialization"));
    getWidget(mSpecializationName, "SpecializationName");
    mSpecializationName->eventMouseButtonClick += MyGUI::newDelegate(this, &CreateClassDialog::onSpecializationClicked);

    setText("FavoriteAttributesT", mWindowManager.getGameSettingString("sChooseClassMenu2", "Favorite Attributes:"));
    getWidget(mFavoriteAttribute0, "FavoriteAttribute0");
    getWidget(mFavoriteAttribute1, "FavoriteAttribute1");
    mFavoriteAttribute0->setWindowManager(&mWindowManager);
    mFavoriteAttribute1->setWindowManager(&mWindowManager);
    mFavoriteAttribute0->eventClicked += MyGUI::newDelegate(this, &CreateClassDialog::onAttributeClicked);
    mFavoriteAttribute1->eventClicked += MyGUI::newDelegate(this, &CreateClassDialog::onAttributeClicked);

    setText("MajorSkillT", mWindowManager.getGameSettingString("sSkillClassMajor", ""));
    setText("MinorSkillT", mWindowManager.getGameSettingString("sSkillClassMinor", ""));
    for(int i = 0; i < 5; i++)
    {
        char theIndex = '0'+i;
        getWidget(mMajorSkill[i], std::string("MajorSkill").append(1, theIndex));
        getWidget(mMinorSkill[i], std::string("MinorSkill").append(1, theIndex));
        mSkills.push_back(mMajorSkill[i]);
        mSkills.push_back(mMinorSkill[i]);
    }

    std::vector<Widgets::MWSkillPtr>::const_iterator end = mSkills.end();
    for (std::vector<Widgets::MWSkillPtr>::const_iterator it = mSkills.begin(); it != end; ++it)
    {
        (*it)->setWindowManager(&mWindowManager);
        (*it)->eventClicked += MyGUI::newDelegate(this, &CreateClassDialog::onSkillClicked);
    }

    setText("LabelT", mWindowManager.getGameSettingString("sName", ""));
    getWidget(mEditName, "EditName");

    // Make sure the edit box has focus
    MyGUI::InputManager::getInstance().setKeyFocusWidget(mEditName);

    MyGUI::ButtonPtr descriptionButton;
    getWidget(descriptionButton, "DescriptionButton");
    descriptionButton->setCaption(mWindowManager.getGameSettingString("sCreateClassMenu1", ""));
    descriptionButton->eventMouseButtonClick += MyGUI::newDelegate(this, &CreateClassDialog::onDescriptionClicked);

    MyGUI::ButtonPtr backButton;
    getWidget(backButton, "BackButton");
    backButton->eventMouseButtonClick += MyGUI::newDelegate(this, &CreateClassDialog::onBackClicked);

    MyGUI::ButtonPtr okButton;
    getWidget(okButton, "OKButton");
    okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &CreateClassDialog::onOkClicked);

    // Set default skills, attributes

    mFavoriteAttribute0->setAttributeId(ESM::Attribute::Strength);
    mFavoriteAttribute1->setAttributeId(ESM::Attribute::Agility);

    mMajorSkill[0]->setSkillId(ESM::Skill::Block);
    mMajorSkill[1]->setSkillId(ESM::Skill::Armorer);
    mMajorSkill[2]->setSkillId(ESM::Skill::MediumArmor);
    mMajorSkill[3]->setSkillId(ESM::Skill::HeavyArmor);
    mMajorSkill[4]->setSkillId(ESM::Skill::BluntWeapon);

    mMinorSkill[0]->setSkillId(ESM::Skill::LongBlade);
    mMinorSkill[1]->setSkillId(ESM::Skill::Axe);
    mMinorSkill[2]->setSkillId(ESM::Skill::Spear);
    mMinorSkill[3]->setSkillId(ESM::Skill::Athletics);
    mMinorSkill[4]->setSkillId(ESM::Skill::Enchant);

    setSpecialization(0);
    update();
}
Esempio n. 26
0
InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxManager, const std::string& message, const std::vector<std::string>& buttons)
  : Layout("openmw_interactive_messagebox_layout.xml")
  , mMessageBoxManager(parMessageBoxManager)
  , mButtonPressed(-1)
{
    int fixedWidth = 500;
    int textPadding = 10; // padding between text-widget and main-widget
    int textButtonPadding = 20; // padding between the text-widget und the button-widget
    int buttonLeftPadding = 10; // padding between the buttons if horizontal
    int buttonTopPadding = 5; // ^-- if vertical
    int buttonPadding = 5; // padding between button label and button itself
    int buttonMainPadding = 10; // padding between buttons and bottom of the main widget

    mMarkedToDelete = false;


    getWidget(mMessageWidget, "message");
    getWidget(mButtonsWidget, "buttons");

    mMessageWidget->setOverflowToTheLeft(true);
    mMessageWidget->addText(message);

    MyGUI::IntSize textSize = mMessageWidget->_getTextSize();

    MyGUI::IntSize gameWindowSize = mMessageBoxManager.mWindowManager->getGui()->getViewSize();

    int biggestButtonWidth = 0;
    int buttonWidth = 0;
    int buttonsWidth = 0;
    int buttonHeight = 0;
    MyGUI::IntCoord dummyCoord(0, 0, 0, 0);

    std::vector<std::string>::const_iterator it;
    for(it = buttons.begin(); it != buttons.end(); ++it)
    {
        MyGUI::ButtonPtr button = mButtonsWidget->createWidget<MyGUI::Button>(
            MyGUI::WidgetStyle::Child,
            std::string("MW_Button"),
            dummyCoord,
            MyGUI::Align::Default);
        button->setCaption(*it);

        button->eventMouseButtonClick = MyGUI::newDelegate(this, &InteractiveMessageBox::mousePressed);

        mButtons.push_back(button);

        buttonWidth = button->_getTextSize().width + 2*buttonPadding + buttonLeftPadding;
        buttonsWidth += buttonWidth;
        buttonHeight = button->_getTextSize().height + 2*buttonPadding + buttonTopPadding;

        if(buttonWidth > biggestButtonWidth)
        {
            biggestButtonWidth = buttonWidth;
        }
    }
    buttonsWidth += buttonLeftPadding;

    MyGUI::IntSize mainWidgetSize;
    if(buttonsWidth < fixedWidth)
    {
        // on one line
        std::cout << "on one line" << std::endl;

        if(textSize.width + 2*textPadding < buttonsWidth)
        {
            std::cout << "width = buttonsWidth" << std::endl;
            mainWidgetSize.width = buttonsWidth;
        }
        else
        {
            mainWidgetSize.width = textSize.width + 3*textPadding;
        }
        mainWidgetSize.height = textSize.height + textButtonPadding + buttonHeight + buttonMainPadding;

        MyGUI::IntCoord absCoord;
        absCoord.left = (gameWindowSize.width - mainWidgetSize.width)/2;
        absCoord.top = (gameWindowSize.height - mainWidgetSize.height)/2;

        std::cout << "width " << mainWidgetSize.width << " height " << mainWidgetSize.height << std::endl;
        std::cout << "left " << absCoord.left << " top " << absCoord.top << std::endl;

        mMainWidget->setCoord(absCoord);
        mMainWidget->setSize(mainWidgetSize);


        MyGUI::IntCoord messageWidgetCoord;
        messageWidgetCoord.left = (mainWidgetSize.width - textSize.width)/2;
        messageWidgetCoord.top = textPadding;
        mMessageWidget->setCoord(messageWidgetCoord);

        mMessageWidget->setSize(textSize);

        MyGUI::IntCoord buttonCord;
        MyGUI::IntSize buttonSize(0, buttonHeight);
        int left = (mainWidgetSize.width - buttonsWidth)/2 + buttonPadding;

        std::vector<MyGUI::ButtonPtr>::const_iterator button;
        for(button = mButtons.begin(); button != mButtons.end(); ++button)
        {
            buttonCord.left = left;
            buttonCord.top = textSize.height + textButtonPadding;

            buttonSize.width = (*button)->_getTextSize().width + 2*buttonPadding;
            buttonSize.height = (*button)->_getTextSize().height + 2*buttonPadding;

            (*button)->setCoord(buttonCord);
            (*button)->setSize(buttonSize);

            left += buttonSize.width + buttonLeftPadding;
        }
    }
    else
    {
        // among each other

        if(biggestButtonWidth > textSize.width) {
            mainWidgetSize.width = biggestButtonWidth + buttonTopPadding;
        }
        else {
            mainWidgetSize.width = textSize.width + 3*textPadding;
        }
        mainWidgetSize.height = textSize.height + 2*textPadding + textButtonPadding + buttonHeight * buttons.size() + buttonMainPadding;

        std::cout << "biggestButtonWidth " << biggestButtonWidth << " textSize.width " << textSize.width << std::endl;
        std::cout << "width " << mainWidgetSize.width << " height " << mainWidgetSize.height << std::endl;
        mMainWidget->setSize(mainWidgetSize);

        MyGUI::IntCoord absCoord;
        absCoord.left = (gameWindowSize.width - mainWidgetSize.width)/2;
        absCoord.top = (gameWindowSize.height - mainWidgetSize.height)/2;

        mMainWidget->setCoord(absCoord);
        mMainWidget->setSize(mainWidgetSize);


        MyGUI::IntCoord messageWidgetCoord;
        messageWidgetCoord.left = (mainWidgetSize.width - textSize.width)/2;
        messageWidgetCoord.top = textPadding;
        mMessageWidget->setCoord(messageWidgetCoord);

        mMessageWidget->setSize(textSize);

        MyGUI::IntCoord buttonCord;
        MyGUI::IntSize buttonSize(0, buttonHeight);

        int top = textButtonPadding + buttonTopPadding + textSize.height;

        std::vector<MyGUI::ButtonPtr>::const_iterator button;
        for(button = mButtons.begin(); button != mButtons.end(); ++button)
        {
            buttonSize.width = (*button)->_getTextSize().width + buttonPadding*2;
            buttonSize.height = (*button)->_getTextSize().height + buttonPadding*2;

            buttonCord.top = top;
            buttonCord.left = (mainWidgetSize.width - buttonSize.width)/2 - 5; // FIXME: -5 is not so nice :/

            (*button)->setCoord(buttonCord);
            (*button)->setSize(buttonSize);

            top += buttonSize.height + 2*buttonTopPadding;
        }

    }
}
Esempio n. 27
0
void CreateClassDialog::setNextButtonShow(bool shown)
{
    MyGUI::ButtonPtr descriptionButton;
    getWidget(descriptionButton, "DescriptionButton");

    MyGUI::ButtonPtr backButton;
    getWidget(backButton, "BackButton");

    MyGUI::ButtonPtr okButton;
    getWidget(okButton, "OKButton");

    // TODO: All hardcoded coords for buttons are temporary, will be replaced with a dynamic system.
    if (shown)
    {
        okButton->setCaption("Next");

        // Adjust back button when next is shown
        descriptionButton->setCoord(MyGUI::IntCoord(207 - 18, 158, 143, 23));
        backButton->setCoord(MyGUI::IntCoord(356 - 18, 158, 53, 23));
        okButton->setCoord(MyGUI::IntCoord(417 - 18, 158, 42 + 18, 23));
    }
    else
    {
        okButton->setCaption("OK");
        descriptionButton->setCoord(MyGUI::IntCoord(207, 158, 143, 23));
        backButton->setCoord(MyGUI::IntCoord(356, 158, 53, 23));
        okButton->setCoord(MyGUI::IntCoord(417, 158, 42, 23));
    }
}
Esempio n. 28
0
SelectSkillDialog::SelectSkillDialog(MWWorld::Environment& environment, MyGUI::IntSize gameWindowSize)
  : WindowBase("openmw_chargen_select_skill_layout.xml", environment)
{
    // Centre dialog
    center();

    WindowManager *wm = environment.mWindowManager;

    setText("LabelT", wm->getGameSettingString("sSkillsMenu1", ""));
    setText("CombatLabelT", wm->getGameSettingString("sSpecializationCombat", ""));
    setText("MagicLabelT", wm->getGameSettingString("sSpecializationMagic", ""));
    setText("StealthLabelT", wm->getGameSettingString("sSpecializationStealth", ""));

    for(int i = 0; i < 9; i++)
    {
        char theIndex = '0'+i;
        getWidget(combatSkill[i],  std::string("CombatSkill").append(1, theIndex));
        getWidget(magicSkill[i],   std::string("MagicSkill").append(1, theIndex)); 
        getWidget(stealthSkill[i], std::string("StealthSkill").append(1, theIndex));
    }

    struct {Widgets::MWSkillPtr widget; ESM::Skill::SkillEnum skillId;} skills[3][9] = {
        {
            {combatSkill[0], ESM::Skill::Block},
            {combatSkill[1], ESM::Skill::Armorer},
            {combatSkill[2], ESM::Skill::MediumArmor},
            {combatSkill[3], ESM::Skill::HeavyArmor},
            {combatSkill[4], ESM::Skill::BluntWeapon},
            {combatSkill[5], ESM::Skill::LongBlade},
            {combatSkill[6], ESM::Skill::Axe},
            {combatSkill[7], ESM::Skill::Spear},
            {combatSkill[8], ESM::Skill::Athletics}
        },   
        {    
            {magicSkill[0], ESM::Skill::Enchant},
            {magicSkill[1], ESM::Skill::Destruction},
            {magicSkill[2], ESM::Skill::Alteration},
            {magicSkill[3], ESM::Skill::Illusion},
            {magicSkill[4], ESM::Skill::Conjuration},
            {magicSkill[5], ESM::Skill::Mysticism},
            {magicSkill[6], ESM::Skill::Restoration},
            {magicSkill[7], ESM::Skill::Alchemy},
            {magicSkill[8], ESM::Skill::Unarmored}
        },   
        {    
            {stealthSkill[0], ESM::Skill::Security},
            {stealthSkill[1], ESM::Skill::Sneak},
            {stealthSkill[2], ESM::Skill::Acrobatics},
            {stealthSkill[3], ESM::Skill::LightArmor},
            {stealthSkill[4], ESM::Skill::ShortBlade},
            {stealthSkill[5] ,ESM::Skill::Marksman},
            {stealthSkill[6] ,ESM::Skill::Mercantile},
            {stealthSkill[7] ,ESM::Skill::Speechcraft},
            {stealthSkill[8] ,ESM::Skill::HandToHand}
        }
    };

    for (int spec = 0; spec < 3; ++spec)
    {
        for (int i = 0; i < 9; ++i)
        {
            skills[spec][i].widget->setWindowManager(wm);
            skills[spec][i].widget->setSkillId(skills[spec][i].skillId);
            skills[spec][i].widget->eventClicked = MyGUI::newDelegate(this, &SelectSkillDialog::onSkillClicked);
        }
    }

    // TODO: These buttons should be managed by a Dialog class
    MyGUI::ButtonPtr cancelButton;
    getWidget(cancelButton, "CancelButton");
    cancelButton->setCaption(wm->getGameSettingString("sCancel", ""));
    cancelButton->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectSkillDialog::onCancelClicked);
}
Esempio n. 29
0
//-------------------------------------------------------------------------------
void MainMenu::init()
{
    int winHeight = GlbVar.ogreWindow->getHeight();
    int winWidth = GlbVar.ogreWindow->getWidth();
    GlbVar.fader->abortFade(0);

    //Gotta see where we click. :-)
    GlbVar.gui->setVisiblePointer(true);

    //Background, logo.
    mBackground = GlbVar.gui->createWidget<MyGUI::StaticImage>("StaticImage", MyGUI::IntCoord(0,0,winWidth,winHeight), MyGUI::Align::Default, "Back");
    mBackground->setImageTexture("MainMenuBgr.png");

    int logoX = winWidth - (LOGO_WIDTH + 5);
    int logoY = winHeight - (LOGO_HEIGHT + 5);
    mLogo = GlbVar.gui->createWidget<MyGUI::StaticImage>("StaticImage", MyGUI::IntCoord(logoX, logoY, LOGO_WIDTH, LOGO_HEIGHT), MyGUI::Align::Default, "Back");
    mLogo->setImageTexture("MainMenuLogo.png");

    //Get the Window.
    MyGUI::LayoutManager::getInstance().load("MainMenu.layout");
    mWindow = GlbVar.gui->findWidget<MyGUI::Window>("win_mainMenu");

    //Buttons, events.
    MyGUI::ButtonPtr button;
    button = GlbVar.gui->findWidget<MyGUI::Button>("but_newGame");
    button->eventMouseButtonClick = MyGUI::newDelegate(this, &MainMenu::onClickNewGame);

    button = GlbVar.gui->findWidget<MyGUI::Button>("but_continueGame");
    button->eventMouseButtonClick = MyGUI::newDelegate(this, &MainMenu::onClickContinueGame);
    if (GlbVar.records.firstTime)
        button->setEnabled(false);

    button = GlbVar.gui->findWidget<MyGUI::Button>("but_levelSelect");
    button->eventMouseButtonClick = MyGUI::newDelegate(this, &MainMenu::onClickLevelSelect);
    if (GlbVar.records.firstTime)
        button->setEnabled(false);

    button = GlbVar.gui->findWidget<MyGUI::Button>("but_userLevel");
    button->eventMouseButtonClick = MyGUI::newDelegate(this, &MainMenu::onClickUserLevel);
    if (GlbVar.userNgfNames.empty())
        button->setEnabled(false);

    button = GlbVar.gui->findWidget<MyGUI::Button>("but_options");
    button->eventMouseButtonClick = MyGUI::newDelegate(this, &MainMenu::onClickOptions);

    button = GlbVar.gui->findWidget<MyGUI::Button>("but_credits");
    button->eventMouseButtonClick = MyGUI::newDelegate(this, &MainMenu::onClickCredits);

    button = GlbVar.gui->findWidget<MyGUI::Button>("but_quit");
    button->eventMouseButtonClick = MyGUI::newDelegate(this, &MainMenu::onClickQuit);

    //Window properties.
    //Children don't inherit alpha.
    MyGUI::EnumeratorWidgetPtr iter = mWindow->getEnumerator();
    while (iter.next())
    {
        iter.current()->setInheritsAlpha(false);
    }

    mWindow->setAlpha(0);
    mWindow->setPosition(30,5);

    //Create child interfaces.

    //Level select.
    mLevelSelect = new LevelSelect();

    //Credits.
    MyGUI::LayoutManager::getInstance().load("Credits.layout");
    mCreditsWindow = GlbVar.gui->findWidget<MyGUI::Window>("win_credits");
    mCreditsWindow->setVisible(false);

    int height = mCreditsWindow->getHeight();
    int width = mCreditsWindow->getWidth();
    mCreditsWindow->setCoord(MyGUI::IntCoord((winWidth - width)*0.5, (winHeight - height)*0.5, width, height));

    button = GlbVar.gui->findWidget<MyGUI::Button>("but_cr_ok");
    button->eventMouseButtonClick = MyGUI::newDelegate(this, &MainMenu::onClickCloseCredits);

    MyGUI::EditPtr credits = GlbVar.gui->findWidget<MyGUI::Edit>("edt_cr_credits");
    credits->setOnlyText(creditsStr);
    credits->setTextAlign(MyGUI::Align::Left | MyGUI::Align::Top);

    //User level.
    MyGUI::LayoutManager::getInstance().load("LoadUserLevel.layout");
    mUserLevelWindow = GlbVar.gui->findWidget<MyGUI::Window>("win_userLevel");
    height = mUserLevelWindow->getHeight();
    width = mUserLevelWindow->getWidth();
    mUserLevelWindow->setCoord(MyGUI::IntCoord((winWidth - width)*0.5, (winHeight - height)*0.5, width, height));
    mUserLevelWindow->setVisible(false);

    //Tell the buttons to tell us.
    button = GlbVar.gui->findWidget<MyGUI::Button>("but_loadUserLevel");
    button->eventMouseButtonClick = MyGUI::newDelegate(this, &MainMenu::onClickLoadUserLevel);

    button = GlbVar.gui->findWidget<MyGUI::Button>("but_cancelUserLevel");
    button->eventMouseButtonClick = MyGUI::newDelegate(this, &MainMenu::onClickCancelUserLevel);

    //Populate the user level list.
    MyGUI::ComboBox *list = GlbVar.gui->findWidget<MyGUI::ComboBox>("cmb_userLevel");

    for (std::vector<Ogre::String>::iterator iter = GlbVar.userNgfNames.begin(); iter != GlbVar.userNgfNames.end(); ++iter)
        list->addItem(*iter);

    if (!(GlbVar.userNgfNames.empty()))
        list->setIndexSelected(0);
}
Esempio n. 30
0
RaceDialog::RaceDialog(MWBase::WindowManager& parWindowManager)
  : WindowBase("openmw_chargen_race.layout", parWindowManager)
  , mGenderIndex(0)
  , mFaceIndex(0)
  , mHairIndex(0)
  , mFaceCount(10)
  , mHairCount(14)
{
    // Centre dialog
    center();

    // These are just demo values, you should replace these with
    // real calls from outside the class later.

    setText("AppearanceT", mWindowManager.getGameSettingString("sRaceMenu1", "Appearance"));
    getWidget(mAppearanceBox, "AppearanceBox");

    getWidget(mHeadRotate, "HeadRotate");
    mHeadRotate->setScrollRange(50);
    mHeadRotate->setScrollPosition(20);
    mHeadRotate->setScrollViewPage(10);
    mHeadRotate->eventScrollChangePosition += MyGUI::newDelegate(this, &RaceDialog::onHeadRotate);

    // Set up next/previous buttons
    MyGUI::ButtonPtr prevButton, nextButton;

    setText("GenderChoiceT", mWindowManager.getGameSettingString("sRaceMenu2", "Change Sex"));
    getWidget(prevButton, "PrevGenderButton");
    getWidget(nextButton, "NextGenderButton");
    prevButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousGender);
    nextButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectNextGender);

    setText("FaceChoiceT", mWindowManager.getGameSettingString("sRaceMenu3", "Change Face"));
    getWidget(prevButton, "PrevFaceButton");
    getWidget(nextButton, "NextFaceButton");
    prevButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousFace);
    nextButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectNextFace);

    setText("HairChoiceT", mWindowManager.getGameSettingString("sRaceMenu4", "Change Hair"));
    getWidget(prevButton, "PrevHairButton");
    getWidget(nextButton, "NextHairButton");
    prevButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousHair);
    nextButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectNextHair);

    setText("RaceT", mWindowManager.getGameSettingString("sRaceMenu4", "Race"));
    getWidget(mRaceList, "RaceList");
    mRaceList->setScrollVisible(true);
    mRaceList->eventListSelectAccept += MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
    mRaceList->eventListMouseItemActivate += MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
    mRaceList->eventListChangePosition += MyGUI::newDelegate(this, &RaceDialog::onSelectRace);

    setText("SkillsT", mWindowManager.getGameSettingString("sBonusSkillTitle", "Skill Bonus"));
    getWidget(mSkillList, "SkillList");
    setText("SpellPowerT", mWindowManager.getGameSettingString("sRaceMenu7", "Specials"));
    getWidget(mSpellPowerList, "SpellPowerList");

    MyGUI::ButtonPtr backButton;
    getWidget(backButton, "BackButton");
    backButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onBackClicked);

    MyGUI::ButtonPtr okButton;
    getWidget(okButton, "OKButton");
    okButton->setCaption(mWindowManager.getGameSettingString("sOK", ""));
    okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onOkClicked);

    updateRaces();
    updateSkills();
    updateSpellPowers();
}