From f90d1a1bcd8b82886cf8ae07f0d0d83e11e2f53d Mon Sep 17 00:00:00 2001 From: Erik Schilling Date: Sat, 19 May 2012 13:11:59 +0200 Subject: Fixed skill display for manaserv - shows manaserv skills at all - shows the progress bar for manaserv skills again - shows the level for this skills (server side patch needed) TODO: URGENT: Fix attributes and skills getting stored in same list. Reviewed-by: Bertram. --- src/gui/skilldialog.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/gui/skilldialog.cpp') 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 { -- cgit v1.2.3-70-g09d2