fix reentering race selection

This commit is contained in:
greye 2012-11-10 21:54:43 +04:00
parent 0d33d005a5
commit 623e00531d

View file

@ -109,8 +109,15 @@ void RaceDialog::open()
MWBase::Environment::get().getWorld ()->setupExternalRendering (*mPreview); MWBase::Environment::get().getWorld ()->setupExternalRendering (*mPreview);
mPreview->update (0); mPreview->update (0);
setRaceId(mPreview->getPrototype().mRace); const ESM::NPC proto = mPreview->getPrototype();
setRaceId(proto.mRace);
recountParts(); recountParts();
std::string index = proto.mHead.substr(proto.mHead.size() - 2, 2);
mFaceIndex = boost::lexical_cast<int>(index) - 1;
index = proto.mHair.substr(proto.mHair.size() - 2, 2);
mHairIndex = boost::lexical_cast<int>(index) - 1;
mPreviewImage->setImageTexture ("CharacterHeadPreview"); mPreviewImage->setImageTexture ("CharacterHeadPreview");
} }
@ -240,7 +247,7 @@ void RaceDialog::onSelectPreviousHair(MyGUI::Widget*)
void RaceDialog::onSelectNextHair(MyGUI::Widget*) void RaceDialog::onSelectNextHair(MyGUI::Widget*)
{ {
mHairIndex = wrap(mHairIndex - 1, mHairCount); mHairIndex = wrap(mHairIndex + 1, mHairCount);
updatePreview(); updatePreview();
} }