diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-21 13:01:00 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-21 13:01:00 +0300 |
commit | ba88670fe4b5f4606f80651f6433cc755ab6b6c1 (patch) | |
tree | b0f8c94e63385df3fafaf8dfe70cc3d0357146a4 /src/gui/windows/skilldialog.cpp | |
parent | ebd21ed95b475d7a411bc6d341fb287b0c125509 (diff) | |
download | mv-ba88670fe4b5f4606f80651f6433cc755ab6b6c1.tar.gz mv-ba88670fe4b5f4606f80651f6433cc755ab6b6c1.tar.bz2 mv-ba88670fe4b5f4606f80651f6433cc755ab6b6c1.tar.xz mv-ba88670fe4b5f4606f80651f6433cc755ab6b6c1.zip |
Fix updating skills window if some skills was removed.
Diffstat (limited to 'src/gui/windows/skilldialog.cpp')
-rw-r--r-- | src/gui/windows/skilldialog.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index feef1dba6..d08ee4d1a 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -196,8 +196,31 @@ void SkillDialog::update() FOR_EACH (SkillMap::const_iterator, it, mSkills) { - if ((*it).second && (*it).second->modifiable) - (*it).second->update(); + SkillInfo *const info = (*it).second; + if (info && info->modifiable) + info->update(); + } +} + +void SkillDialog::updateModels() +{ + std::set<SkillModel*> models; + + FOR_EACH (SkillMap::const_iterator, it, mSkills) + { + SkillInfo *const info = (*it).second; + if (info) + { + SkillModel *const model = info->model; + if (model) + models.insert(model); + } + } + FOR_EACH (std::set<SkillModel*>::iterator, it, models) + { + SkillModel *const model = *it; + if (model) + model->updateVisibilities(); } } @@ -218,7 +241,10 @@ void SkillDialog::hideSkills(const SkillOwner::Type owner) { SkillInfo *const info = (*it).second; if (info && info->owner == owner) + { + PlayerInfo::setSkillLevel(info->id, 0); info->visible = false; + } } } |