Allow double click / Enter key for accepting race/class/birthsign

actorid
scrawl 11 years ago
parent a8a09762ce
commit edff88542b

@ -33,8 +33,7 @@ namespace MWGui
getWidget(mBirthList, "BirthsignList");
mBirthList->setScrollVisible(true);
mBirthList->eventListSelectAccept += MyGUI::newDelegate(this, &BirthDialog::onSelectBirth);
mBirthList->eventListMouseItemActivate += MyGUI::newDelegate(this, &BirthDialog::onSelectBirth);
mBirthList->eventListSelectAccept += MyGUI::newDelegate(this, &BirthDialog::onAccept);
mBirthList->eventListChangePosition += MyGUI::newDelegate(this, &BirthDialog::onSelectBirth);
MyGUI::Button* backButton;
@ -97,6 +96,14 @@ namespace MWGui
eventDone(this);
}
void BirthDialog::onAccept(MyGUI::ListBox *_sender, size_t _index)
{
onSelectBirth(_sender, _index);
if(mBirthList->getIndexSelected() == MyGUI::ITEM_NONE)
return;
eventDone(this);
}
void BirthDialog::onBackClicked(MyGUI::Widget* _sender)
{
eventBack();

@ -38,6 +38,7 @@ namespace MWGui
protected:
void onSelectBirth(MyGUI::ListBox* _sender, size_t _index);
void onAccept(MyGUI::ListBox* _sender, size_t index);
void onOkClicked(MyGUI::Widget* _sender);
void onBackClicked(MyGUI::Widget* _sender);

@ -82,8 +82,7 @@ namespace MWGui
getWidget(mClassList, "ClassList");
mClassList->setScrollVisible(true);
mClassList->eventListSelectAccept += MyGUI::newDelegate(this, &PickClassDialog::onSelectClass);
mClassList->eventListMouseItemActivate += MyGUI::newDelegate(this, &PickClassDialog::onSelectClass);
mClassList->eventListSelectAccept += MyGUI::newDelegate(this, &PickClassDialog::onAccept);
mClassList->eventListChangePosition += MyGUI::newDelegate(this, &PickClassDialog::onSelectClass);
getWidget(mClassImage, "ClassImage");
@ -152,6 +151,14 @@ namespace MWGui
eventBack();
}
void PickClassDialog::onAccept(MyGUI::ListBox* _sender, size_t _index)
{
onSelectClass(_sender, _index);
if(mClassList->getIndexSelected() == MyGUI::ITEM_NONE)
return;
eventDone(this);
}
void PickClassDialog::onSelectClass(MyGUI::ListBox* _sender, size_t _index)
{
if (_index == MyGUI::ITEM_NONE)

@ -111,6 +111,7 @@ namespace MWGui
protected:
void onSelectClass(MyGUI::ListBox* _sender, size_t _index);
void onAccept(MyGUI::ListBox* _sender, size_t _index);
void onOkClicked(MyGUI::Widget* _sender);
void onBackClicked(MyGUI::Widget* _sender);

@ -70,8 +70,7 @@ namespace MWGui
setText("RaceT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sRaceMenu5", "Race"));
getWidget(mRaceList, "RaceList");
mRaceList->setScrollVisible(true);
mRaceList->eventListSelectAccept += MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
mRaceList->eventListMouseItemActivate += MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
mRaceList->eventListSelectAccept += MyGUI::newDelegate(this, &RaceDialog::onAccept);
mRaceList->eventListChangePosition += MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
setText("SkillsT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sBonusSkillTitle", "Skill Bonus"));
@ -241,6 +240,14 @@ namespace MWGui
updateSpellPowers();
}
void RaceDialog::onAccept(MyGUI::ListBox *_sender, size_t _index)
{
onSelectRace(_sender, _index);
if(mRaceList->getIndexSelected() == MyGUI::ITEM_NONE)
return;
eventDone(this);
}
void RaceDialog::getBodyParts (int part, std::vector<std::string>& out)
{
out.clear();

@ -67,6 +67,7 @@ namespace MWGui
void onSelectNextHair(MyGUI::Widget* _sender);
void onSelectRace(MyGUI::ListBox* _sender, size_t _index);
void onAccept(MyGUI::ListBox* _sender, size_t _index);
void onOkClicked(MyGUI::Widget* _sender);
void onBackClicked(MyGUI::Widget* _sender);

Loading…
Cancel
Save