fix skill progress bar v2

both widgets display their own progess indicator. it was being set for
value (when you hovered over the level of your skill, eg the "5" in
"Acrobatics    5"), but not for the name.

this fixes that, but the progress information is being stored/displayed
by two different widgets for one skill
This commit is contained in:
Mitchell Schwitzer 2017-03-12 16:44:56 -07:00
parent 465b7361e1
commit 7960d5a9a7
2 changed files with 3 additions and 4 deletions

View file

@ -237,10 +237,12 @@ namespace MWGui
nameWidget->setSize(nameWidget->getWidth() - (widthAfter-widthBefore), nameWidget->getHeight()); nameWidget->setSize(nameWidget->getWidth() - (widthAfter-widthBefore), nameWidget->getHeight());
} }
if (value.getBase() < 100) if (value.getBase() < 100) {
setSkillProgress(nameWidget, value.getProgress(), parSkill);
setSkillProgress(valueWidget, value.getProgress(), parSkill); setSkillProgress(valueWidget, value.getProgress(), parSkill);
} }
} }
}
void StatsWindow::configureSkills (const std::vector<int>& major, const std::vector<int>& minor) void StatsWindow::configureSkills (const std::vector<int>& major, const std::vector<int>& minor)
{ {

View file

@ -338,19 +338,16 @@ namespace MWMechanics
} }
} }
bool updateSkills = false;
//Loop over ESM::Skill::SkillEnum //Loop over ESM::Skill::SkillEnum
for(int i = 0; i < ESM::Skill::Length; ++i) for(int i = 0; i < ESM::Skill::Length; ++i)
{ {
if(stats.getSkill(i) != mWatchedSkills[i] || mWatchedStatsEmpty) if(stats.getSkill(i) != mWatchedSkills[i] || mWatchedStatsEmpty)
{ {
updateSkills = true;
mWatchedSkills[i] = stats.getSkill(i); mWatchedSkills[i] = stats.getSkill(i);
winMgr->setValue((ESM::Skill::SkillEnum)i, stats.getSkill(i)); winMgr->setValue((ESM::Skill::SkillEnum)i, stats.getSkill(i));
} }
} }
if (updateSkills) { winMgr->updateSkillArea(); }
winMgr->setValue("level", stats.getLevel()); winMgr->setValue("level", stats.getLevel());
mWatchedStatsEmpty = false; mWatchedStatsEmpty = false;