summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
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();