summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-21 13:01:00 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-21 13:01:00 +0300
commitba88670fe4b5f4606f80651f6433cc755ab6b6c1 (patch)
treeb0f8c94e63385df3fafaf8dfe70cc3d0357146a4 /src/gui
parentebd21ed95b475d7a411bc6d341fb287b0c125509 (diff)
downloadmanaplus-ba88670fe4b5f4606f80651f6433cc755ab6b6c1.tar.gz
manaplus-ba88670fe4b5f4606f80651f6433cc755ab6b6c1.tar.bz2
manaplus-ba88670fe4b5f4606f80651f6433cc755ab6b6c1.tar.xz
manaplus-ba88670fe4b5f4606f80651f6433cc755ab6b6c1.zip
Fix updating skills window if some skills was removed.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/windows/skilldialog.cpp30
-rw-r--r--src/gui/windows/skilldialog.h2
2 files changed, 30 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;
+ }
}
}
diff --git a/src/gui/windows/skilldialog.h b/src/gui/windows/skilldialog.h
index ddeea2cc7..1a24d4e93 100644
--- a/src/gui/windows/skilldialog.h
+++ b/src/gui/windows/skilldialog.h
@@ -70,6 +70,8 @@ class SkillDialog final : public Window,
*/
void update();
+ void updateModels();
+
void loadXmlFile(const std::string &fileName);
void clearSkills();