forked from mirror/openmw-tes3mp
store birthsign in MWWorld::Player
This commit is contained in:
parent
83e758ee50
commit
2a86432887
5 changed files with 21 additions and 10 deletions
|
@ -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,
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,6 @@ namespace MWMechanics
|
|||
bool mUpdatePlayer;
|
||||
bool mClassSelected;
|
||||
bool mRaceSelected;
|
||||
std::string mSign;
|
||||
Actors mActors;
|
||||
|
||||
void buildPlayer();
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue