summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/skilldialog.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp
index 68993220..485d5d5b 100644
--- a/src/gui/skilldialog.cpp
+++ b/src/gui/skilldialog.cpp
@@ -278,8 +278,7 @@ void SkillDialog::update()
for (SkillMap::iterator it = mSkills.begin(); it != mSkills.end(); it++)
{
- if ((*it).second->modifiable)
- (*it).second->update();
+ (*it).second->update();
}
}
@@ -292,6 +291,12 @@ void SkillDialog::event(Event::Channel channel, const Event &event)
update();
}
}
+ else if (event.getType() == Event::UpdateStat)
+ {
+ SkillMap::iterator it = mSkills.find(event.getInt("id"));
+ if (it != mSkills.end())
+ it->second->update();
+ }
}
void SkillDialog::clearSkills()
@@ -476,8 +481,8 @@ void SkillInfo::update()
if (exp.second)
{
- skillExp = strprintf("%d / %d", exp.first, exp.second);
- progress = (float) exp.first / exp.second;
+ progress = exp.second != 0 ? (float) exp.first / exp.second : 0;
+ skillExp = strprintf("%.2f%%", progress * 100);
}
else
{