1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 20:19:57 +00:00

Implement sBookSkillMessage GMST

This commit is contained in:
Capostrophic 2018-03-24 13:43:18 +03:00 committed by Capostrophic
parent 9b8c56761b
commit 4f64ba7b7f
3 changed files with 8 additions and 3 deletions

View file

@ -214,7 +214,7 @@ void MWMechanics::NpcStats::useSkill (int skillIndex, const ESM::Class& class_,
} }
} }
void MWMechanics::NpcStats::increaseSkill(int skillIndex, const ESM::Class &class_, bool preserveProgress) void MWMechanics::NpcStats::increaseSkill(int skillIndex, const ESM::Class &class_, bool preserveProgress, bool readBook)
{ {
int base = getSkill (skillIndex).getBase(); int base = getSkill (skillIndex).getBase();
@ -256,9 +256,14 @@ void MWMechanics::NpcStats::increaseSkill(int skillIndex, const ESM::Class &clas
MWBase::Environment::get().getWindowManager()->playSound("skillraise"); MWBase::Environment::get().getWindowManager()->playSound("skillraise");
std::stringstream message; std::stringstream message;
if (readBook)
message << std::string("#{sBookSkillMessage}\n");
message << boost::format(MWBase::Environment::get().getWindowManager ()->getGameSettingString ("sNotifyMessage39", "")) message << boost::format(MWBase::Environment::get().getWindowManager ()->getGameSettingString ("sNotifyMessage39", ""))
% std::string("#{" + ESM::Skill::sSkillNameIds[skillIndex] + "}") % std::string("#{" + ESM::Skill::sSkillNameIds[skillIndex] + "}")
% static_cast<int> (base); % static_cast<int> (base);
MWBase::Environment::get().getWindowManager ()->messageBox(message.str(), MWGui::ShowInDialogueMode_Never); MWBase::Environment::get().getWindowManager ()->messageBox(message.str(), MWGui::ShowInDialogueMode_Never);
if (mLevelProgress >= gmst.find("iLevelUpTotal")->getInt()) if (mLevelProgress >= gmst.find("iLevelUpTotal")->getInt())

View file

@ -81,7 +81,7 @@ namespace MWMechanics
void useSkill (int skillIndex, const ESM::Class& class_, int usageType = -1, float extraFactor=1.f); void useSkill (int skillIndex, const ESM::Class& class_, int usageType = -1, float extraFactor=1.f);
///< Increase skill by usage. ///< Increase skill by usage.
void increaseSkill (int skillIndex, const ESM::Class& class_, bool preserveProgress); void increaseSkill (int skillIndex, const ESM::Class& class_, bool preserveProgress, bool readBook = false);
int getLevelProgress() const; int getLevelProgress() const;

View file

@ -52,7 +52,7 @@ namespace MWWorld
playerRef->mBase->mClass playerRef->mBase->mClass
); );
npcStats.increaseSkill (ref->mBase->mData.mSkillId, *class_, true); npcStats.increaseSkill (ref->mBase->mData.mSkillId, *class_, true, true);
npcStats.flagAsUsed (ref->mBase->mId); npcStats.flagAsUsed (ref->mBase->mId);
} }