mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 13:23:53 +00:00
Merge branch 'Show-level-multipliers-in-levelup-tooltip' into 'master'
Show level multipliers in levelup tooltip Closes #5783 See merge request OpenMW/openmw!518
This commit is contained in:
commit
c6f14cde20
3 changed files with 11 additions and 17 deletions
|
@ -337,21 +337,22 @@ namespace MWGui
|
||||||
int max = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("iLevelUpTotal")->mValue.getInteger();
|
int max = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("iLevelUpTotal")->mValue.getInteger();
|
||||||
getWidget(levelWidget, i==0 ? "Level_str" : "LevelText");
|
getWidget(levelWidget, i==0 ? "Level_str" : "LevelText");
|
||||||
|
|
||||||
std::stringstream detail;
|
|
||||||
for (int i = 0; i < ESM::Attribute::Length; ++i)
|
|
||||||
{
|
|
||||||
if (auto increase = PCstats.getLevelUpAttributeIncrease(i))
|
|
||||||
detail << (detail.str().empty() ? "" : "\n") << "#{"
|
|
||||||
<< MyGUI::TextIterator::toTagsString(ESM::Attribute::sGmstAttributeIds[i])
|
|
||||||
<< "} x" << MyGUI::utility::toString(increase);
|
|
||||||
}
|
|
||||||
if (!detail.str().empty())
|
|
||||||
levelWidget->setUserString("Caption_LevelDetailText", MyGUI::LanguageManager::getInstance().replaceTags(detail.str()));
|
|
||||||
levelWidget->setUserString("RangePosition_LevelProgress", MyGUI::utility::toString(PCstats.getLevelProgress()));
|
levelWidget->setUserString("RangePosition_LevelProgress", MyGUI::utility::toString(PCstats.getLevelProgress()));
|
||||||
levelWidget->setUserString("Range_LevelProgress", MyGUI::utility::toString(max));
|
levelWidget->setUserString("Range_LevelProgress", MyGUI::utility::toString(max));
|
||||||
levelWidget->setUserString("Caption_LevelProgressText", MyGUI::utility::toString(PCstats.getLevelProgress()) + "/"
|
levelWidget->setUserString("Caption_LevelProgressText", MyGUI::utility::toString(PCstats.getLevelProgress()) + "/"
|
||||||
+ MyGUI::utility::toString(max));
|
+ MyGUI::utility::toString(max));
|
||||||
}
|
}
|
||||||
|
std::stringstream detail;
|
||||||
|
for (int attribute = 0; attribute < ESM::Attribute::Length; ++attribute)
|
||||||
|
{
|
||||||
|
float mult = PCstats.getLevelupAttributeMultiplier(attribute);
|
||||||
|
mult = std::min(mult, 100 - PCstats.getAttribute(attribute).getBase());
|
||||||
|
if (mult > 1)
|
||||||
|
detail << (detail.str().empty() ? "" : "\n") << "#{"
|
||||||
|
<< MyGUI::TextIterator::toTagsString(ESM::Attribute::sGmstAttributeIds[attribute])
|
||||||
|
<< "} x" << MyGUI::utility::toString(mult);
|
||||||
|
}
|
||||||
|
levelWidget->setUserString("Caption_LevelDetailText", MyGUI::LanguageManager::getInstance().replaceTags(detail.str()));
|
||||||
|
|
||||||
setFactions(PCstats.getFactionRanks());
|
setFactions(PCstats.getFactionRanks());
|
||||||
setExpelled(PCstats.getExpelled ());
|
setExpelled(PCstats.getExpelled ());
|
||||||
|
|
|
@ -322,11 +322,6 @@ void MWMechanics::NpcStats::updateHealth()
|
||||||
setHealth(floor(0.5f * (strength + endurance)));
|
setHealth(floor(0.5f * (strength + endurance)));
|
||||||
}
|
}
|
||||||
|
|
||||||
int MWMechanics::NpcStats::getLevelUpAttributeIncrease(int attribute) const
|
|
||||||
{
|
|
||||||
return mSkillIncreases[attribute];
|
|
||||||
}
|
|
||||||
|
|
||||||
int MWMechanics::NpcStats::getLevelupAttributeMultiplier(int attribute) const
|
int MWMechanics::NpcStats::getLevelupAttributeMultiplier(int attribute) const
|
||||||
{
|
{
|
||||||
int num = mSkillIncreases[attribute];
|
int num = mSkillIncreases[attribute];
|
||||||
|
|
|
@ -87,8 +87,6 @@ namespace MWMechanics
|
||||||
|
|
||||||
int getLevelProgress() const;
|
int getLevelProgress() const;
|
||||||
|
|
||||||
int getLevelUpAttributeIncrease(int attribute) const;
|
|
||||||
|
|
||||||
int getLevelupAttributeMultiplier(int attribute) const;
|
int getLevelupAttributeMultiplier(int attribute) const;
|
||||||
|
|
||||||
int getSkillIncreasesForSpecialization(int spec) const;
|
int getSkillIncreasesForSpecialization(int spec) const;
|
||||||
|
|
Loading…
Reference in a new issue