store birthsign in MWWorld::Player

actorid
greye 12 years ago
parent 83e758ee50
commit 2a86432887

@ -252,7 +252,7 @@ namespace MWBase
virtual const ESM::NPC *createRecord(const ESM::NPC &record) = 0; virtual const ESM::NPC *createRecord(const ESM::NPC &record) = 0;
///< Create a new recrod (of type npc) in the ESM store. ///< Create a new recrod (of type npc) in the ESM store.
///< \note special treatment for 'player' record /// \note special treatment for 'player' record
/// \return ID, pointer to created record /// \return ID, pointer to created record
virtual void playAnimationGroup (const MWWorld::Ptr& ptr, const std::string& groupName, virtual void playAnimationGroup (const MWWorld::Ptr& ptr, const std::string& groupName,

@ -252,12 +252,12 @@ void StatsWindow::onFrame ()
} }
setFactions(PCstats.getFactionRanks()); setFactions(PCstats.getFactionRanks());
/*
const ESM::BirthSign *sign =
MWBase::Environment::get().getWorld()->getPlayer().getBirthsign();
setBirthSign((sign != 0) ? sign->mId : ""); const std::string &signId =
*/ MWBase::Environment::get().getWorld()->getPlayer().getBirthSign();
setBirthSign(signId);
if (mChanged) if (mChanged)
updateSkillArea(); updateSkillArea();
} }

@ -90,10 +90,13 @@ namespace MWMechanics
} }
// birthsign // birthsign
if (!mSign.empty()) const std::string &signId =
MWBase::Environment::get().getWorld()->getPlayer().getBirthSign();
if (!signId.empty())
{ {
const ESM::BirthSign *sign = const ESM::BirthSign *sign =
esmStore.get<ESM::BirthSign>().find(mSign); esmStore.get<ESM::BirthSign>().find(signId);
for (std::vector<std::string>::const_iterator iter (sign->mPowers.mList.begin()); for (std::vector<std::string>::const_iterator iter (sign->mPowers.mList.begin());
iter!=sign->mPowers.mList.end(); ++iter) iter!=sign->mPowers.mList.end(); ++iter)
@ -338,7 +341,7 @@ namespace MWMechanics
void MechanicsManager::setPlayerBirthsign (const std::string& id) void MechanicsManager::setPlayerBirthsign (const std::string& id)
{ {
mSign = id; MWBase::Environment::get().getWorld()->getPlayer().setBirthSign(id);
buildPlayer(); buildPlayer();
mUpdatePlayer = true; mUpdatePlayer = true;
} }

@ -29,7 +29,6 @@ namespace MWMechanics
bool mUpdatePlayer; bool mUpdatePlayer;
bool mClassSelected; bool mClassSelected;
bool mRaceSelected; bool mRaceSelected;
std::string mSign;
Actors mActors; Actors mActors;
void buildPlayer(); void buildPlayer();

@ -21,6 +21,7 @@ namespace MWWorld
{ {
LiveCellRef<ESM::NPC> mPlayer; LiveCellRef<ESM::NPC> mPlayer;
MWWorld::CellStore *mCellStore; MWWorld::CellStore *mCellStore;
std::string mSign;
bool mAutoMove; bool mAutoMove;
int mForwardBackward; int mForwardBackward;
@ -40,6 +41,14 @@ namespace MWWorld
return ptr; return ptr;
} }
void setBirthSign(const std::string &sign) {
mSign = sign;
}
const std::string &getBirthSign() const {
return mSign;
}
void setDrawState (MWMechanics::DrawState_ state); void setDrawState (MWMechanics::DrawState_ state);
bool getAutoMove() const bool getAutoMove() const

Loading…
Cancel
Save