diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-10-28 19:53:22 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-10-28 19:53:22 +0300 |
commit | 6b2addaade053d347816d5d61dff53e38ff94e83 (patch) | |
tree | 5b71956d9dc2b5c39c2c9506eb88c8d02714d1fa /src/gui/windows/skilldialog.cpp | |
parent | 4e2c1f3c813bf76ce4d0902f80ec819277f928a6 (diff) | |
download | mv-6b2addaade053d347816d5d61dff53e38ff94e83.tar.gz mv-6b2addaade053d347816d5d61dff53e38ff94e83.tar.bz2 mv-6b2addaade053d347816d5d61dff53e38ff94e83.tar.xz mv-6b2addaade053d347816d5d61dff53e38ff94e83.zip |
Add skill attribute what show skill always.
It allow use always visible fake skills.
New skill attribute: alwaysVisible.
Diffstat (limited to 'src/gui/windows/skilldialog.cpp')
-rw-r--r-- | src/gui/windows/skilldialog.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index bceb8645c..481f8e3c2 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -243,7 +243,8 @@ void SkillDialog::hideSkills(const SkillOwner::Type owner) if (info && info->owner == owner) { PlayerInfo::setSkillLevel(info->id, 0); - info->visible = false; + if (!info->alwaysVisible) + info->visible = false; } } } @@ -316,7 +317,6 @@ void SkillDialog::loadXmlFile(const std::string &fileName) skill = new SkillInfo; skill->id = static_cast<unsigned int>(id); skill->modifiable = false; - skill->visible = false; skill->model = model; skill->update(); skill->useButton = XML::getProperty( @@ -325,6 +325,9 @@ void SkillDialog::loadXmlFile(const std::string &fileName) node, "owner", "player")); skill->errorText = XML::getProperty( node, "errorText", name); + skill->alwaysVisible = XML::getBoolProperty( + node, "alwaysVisible", false); + skill->visible = skill->alwaysVisible; model->addSkill(skill); mSkills[id] = skill; } @@ -442,6 +445,7 @@ void SkillDialog::addSkill(const SkillOwner::Type owner, data->shortName = toString(skill->id); skill->modifiable = modifiable; skill->visible = false; + skill->alwaysVisible = false; skill->model = mDefaultModel; skill->level = level; // TRANSLATORS: skills dialog. skill level |