summaryrefslogtreecommitdiff
path: root/src/gui/windows/skilldialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-28 00:55:13 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-28 00:55:13 +0300
commit01a0e4b658241cc3dbd8a5d11d34a6de48dab159 (patch)
tree37294c079b9a05768b7380f7595784eb73485769 /src/gui/windows/skilldialog.cpp
parent072b727ae4d072d6c84f3331d78ca5a2ac76d271 (diff)
downloadmv-01a0e4b658241cc3dbd8a5d11d34a6de48dab159.tar.gz
mv-01a0e4b658241cc3dbd8a5d11d34a6de48dab159.tar.bz2
mv-01a0e4b658241cc3dbd8a5d11d34a6de48dab159.tar.xz
mv-01a0e4b658241cc3dbd8a5d11d34a6de48dab159.zip
Add strong typed bool type Visible.
Diffstat (limited to 'src/gui/windows/skilldialog.cpp')
-rw-r--r--src/gui/windows/skilldialog.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp
index 22f673a13..6617c200c 100644
--- a/src/gui/windows/skilldialog.cpp
+++ b/src/gui/windows/skilldialog.cpp
@@ -165,7 +165,7 @@ void SkillDialog::action(const ActionEvent &event)
}
else if (eventId == "close")
{
- setVisible(false);
+ setVisible(Visible_false);
}
}
@@ -242,8 +242,8 @@ void SkillDialog::hideSkills(const SkillOwner::Type owner)
if (info && info->owner == owner)
{
PlayerInfo::setSkillLevel(info->id, 0);
- if (!info->alwaysVisible)
- info->visible = false;
+ if (info->alwaysVisible == Visible_false)
+ info->visible = Visible_false;
}
}
}
@@ -324,8 +324,8 @@ 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->alwaysVisible = fromBool(XML::getBoolProperty(
+ node, "alwaysVisible", false), Visible);
skill->castingSrcEffectId = XML::getProperty(
node, "castingSrcEffectId", -1);
skill->castingDstEffectId = XML::getProperty(
@@ -336,7 +336,7 @@ void SkillDialog::loadXmlFile(const std::string &fileName)
}
std::string icon = XML::getProperty(node, "icon", "");
- const int level = skill->alwaysVisible
+ const int level = (skill->alwaysVisible == Visible_true)
? 0 : XML::getProperty(node, "level", 0);
SkillData *data = skill->getData(level);
if (!data)
@@ -414,8 +414,8 @@ void SkillDialog::removeSkill(const int id)
info->level = 0;
info->update();
PlayerInfo::setSkillLevel(id, 0);
- if (!info->alwaysVisible)
- info->visible = false;
+ if (info->alwaysVisible == Visible_false)
+ info->visible = Visible_false;
}
}
}
@@ -474,8 +474,8 @@ void SkillDialog::addSkill(const SkillOwner::Type owner,
data->setIcon("");
data->shortName = toString(skill->id);
skill->modifiable = modifiable;
- skill->visible = false;
- skill->alwaysVisible = false;
+ skill->visible = Visible_false;
+ skill->alwaysVisible = Visible_false;
skill->model = mDefaultModel;
skill->level = level;
// TRANSLATORS: skills dialog. skill level