diff options
author | Erik Schilling <ablu.erikschilling@googlemail.com> | 2012-05-19 13:11:59 +0200 |
---|---|---|
committer | Erik Schilling <ablu.erikschilling@googlemail.com> | 2012-05-25 15:11:46 +0200 |
commit | f90d1a1bcd8b82886cf8ae07f0d0d83e11e2f53d (patch) | |
tree | 0465b232d1b5ab46a0d0b9fd69ab6be7fc7a002a /src/gui/skilldialog.cpp | |
parent | eab4971993edade67edc9445624f6ca28c4b30fe (diff) | |
download | mana-f90d1a1bcd8b82886cf8ae07f0d0d83e11e2f53d.tar.gz mana-f90d1a1bcd8b82886cf8ae07f0d0d83e11e2f53d.tar.bz2 mana-f90d1a1bcd8b82886cf8ae07f0d0d83e11e2f53d.tar.xz mana-f90d1a1bcd8b82886cf8ae07f0d0d83e11e2f53d.zip |
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.
Diffstat (limited to 'src/gui/skilldialog.cpp')
-rw-r--r-- | src/gui/skilldialog.cpp | 13 |
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 { |