summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/skilldialog.cpp18
-rw-r--r--src/gui/windows/skilldialog.h2
2 files changed, 20 insertions, 0 deletions
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp
index 65134aac1..bbefbd5a7 100644
--- a/src/gui/windows/skilldialog.cpp
+++ b/src/gui/windows/skilldialog.cpp
@@ -389,6 +389,24 @@ void SkillDialog::loadXmlFile(const std::string &fileName)
}
}
+void SkillDialog::removeSkill(const int id)
+{
+ const SkillMap::const_iterator it = mSkills.find(id);
+
+ if (it != mSkills.end())
+ {
+ SkillInfo *const info = it->second;
+ if (info)
+ {
+ info->level = 0;
+ info->update();
+ PlayerInfo::setSkillLevel(id, 0);
+ if (!info->alwaysVisible)
+ info->visible = false;
+ }
+ }
+}
+
bool SkillDialog::updateSkill(const int id,
const int range,
const bool modifiable,
diff --git a/src/gui/windows/skilldialog.h b/src/gui/windows/skilldialog.h
index 6c3ab71a3..2628a3d80 100644
--- a/src/gui/windows/skilldialog.h
+++ b/src/gui/windows/skilldialog.h
@@ -118,6 +118,8 @@ class SkillDialog final : public Window,
void slowLogic();
+ void removeSkill(const int id);
+
static void useSkill(const SkillInfo *const info);
private: