Ejemplo n.º 1
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);
}
Ejemplo n.º 2
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);
}
Ejemplo n.º 3
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);
}
Ejemplo n.º 4
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);
}
Ejemplo n.º 5
0
DescriptionDialog::DescriptionDialog(WindowManager& parWindowManager)
  : WindowBase("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", ""));
    int buttonWidth = okButton->getTextSize().width + 24;
    okButton->setCoord(234 - buttonWidth, 214, buttonWidth, 24);

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

    MyGUI::InputManager::getInstance().addWidgetModal(mMainWidget);
}
Ejemplo n.º 6
0
SelectSpecializationDialog::SelectSpecializationDialog(WindowManager& parWindowManager)
  : WindowBase("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::gmstSpecializationIds[ESM::Class::Combat], "");
    std::string magic = mWindowManager.getGameSettingString(ESM::Class::gmstSpecializationIds[ESM::Class::Magic], "");
    std::string stealth = mWindowManager.getGameSettingString(ESM::Class::gmstSpecializationIds[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);
    int buttonWidth = cancelButton->getTextSize().width + 24;
    cancelButton->setCoord(216 - buttonWidth, 90, buttonWidth, 21);

    MyGUI::InputManager::getInstance().addWidgetModal(mMainWidget);
}
Ejemplo n.º 7
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);
}