Reviewmenu: read name, race, class and birthsign from player stats (fixes bug #2628)

0.6.1
Andrei Kortunov 8 years ago
parent fb0c4700a4
commit c93cf822c7

@ -13,6 +13,7 @@
#include "../mwworld/class.hpp"
#include "../mwworld/esmstore.hpp"
#include "../mwworld/player.hpp"
#include "textinput.hpp"
#include "race.hpp"
@ -230,10 +231,19 @@ namespace MWGui
MWBase::Environment::get().getWindowManager()->removeDialog(mReviewDialog);
mReviewDialog = 0;
mReviewDialog = new ReviewDialog();
mReviewDialog->setPlayerName(mPlayerName);
mReviewDialog->setRace(mPlayerRaceId);
mReviewDialog->setClass(mPlayerClass);
mReviewDialog->setBirthSign(mPlayerBirthSignId);
MWBase::World *world = MWBase::Environment::get().getWorld();
const ESM::NPC *playerNpc = world->getPlayerPtr().get<ESM::NPC>()->mBase;
const MWWorld::Player player = world->getPlayer();
const ESM::Class *playerClass = world->getStore().get<ESM::Class>().find(playerNpc->mClass);
mReviewDialog->setPlayerName(playerNpc->mName);
mReviewDialog->setRace(playerNpc->mRace);
mReviewDialog->setClass(*playerClass);
mReviewDialog->setBirthSign(player.getBirthSign());
{
MWWorld::Ptr player = MWMechanics::getPlayer();

Loading…
Cancel
Save