1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-20 14:23:53 +00:00

store birthsign in MWWorld::Player

This commit is contained in:
greye 2012-11-08 18:50:18 +04:00
parent 83e758ee50
commit 2a86432887
5 changed files with 21 additions and 10 deletions

View file

@ -252,7 +252,7 @@ namespace MWBase
virtual const ESM::NPC *createRecord(const ESM::NPC &record) = 0;
///< 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
virtual void playAnimationGroup (const MWWorld::Ptr& ptr, const std::string& groupName,

View file

@ -252,12 +252,12 @@ void StatsWindow::onFrame ()
}
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)
updateSkillArea();
}

View file

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

View file

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

View file

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