summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/widgets/skillinfo.cpp1
-rw-r--r--src/gui/widgets/skillinfo.h1
-rw-r--r--src/gui/windows/skilldialog.cpp10
3 files changed, 9 insertions, 3 deletions
diff --git a/src/gui/widgets/skillinfo.cpp b/src/gui/widgets/skillinfo.cpp
index 514555631..36ae85de9 100644
--- a/src/gui/widgets/skillinfo.cpp
+++ b/src/gui/widgets/skillinfo.cpp
@@ -40,6 +40,7 @@ SkillInfo::SkillInfo() :
skillExp(),
skillEffect(),
useButton(),
+ errorText(),
progress(0.0F),
color(),
dataMap(),
diff --git a/src/gui/widgets/skillinfo.h b/src/gui/widgets/skillinfo.h
index d15d0fe97..c67e055e0 100644
--- a/src/gui/widgets/skillinfo.h
+++ b/src/gui/widgets/skillinfo.h
@@ -48,6 +48,7 @@ struct SkillInfo final
std::string skillExp;
std::string skillEffect;
std::string useButton;
+ std::string errorText;
float progress;
Color color;
SkillDataMap dataMap;
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp
index d08ee4d1a..1fb07e37d 100644
--- a/src/gui/windows/skilldialog.cpp
+++ b/src/gui/windows/skilldialog.cpp
@@ -306,6 +306,10 @@ void SkillDialog::loadXmlFile(const std::string &fileName)
id += SKILL_VAR_MIN_ID;
}
+ std::string name = XML::langProperty(node, "name",
+ // TRANSLATORS: skills dialog. skill id
+ strprintf(_("Skill %d"), id));
+
SkillInfo *skill = getSkill(id);
if (!skill)
{
@@ -319,13 +323,12 @@ void SkillDialog::loadXmlFile(const std::string &fileName)
node, "useButton", _("Use"));
skill->owner = parseOwner(XML::getProperty(
node, "owner", "player"));
+ skill->errorText = XML::getProperty(
+ node, "errorText", name);
model->addSkill(skill);
mSkills[id] = skill;
}
- std::string name = XML::langProperty(node, "name",
- // TRANSLATORS: skills dialog. skill id
- strprintf(_("Skill %d"), id));
std::string icon = XML::getProperty(node, "icon", "");
const int level = XML::getProperty(node, "level", 0);
SkillData *data = skill->getData(level);
@@ -445,6 +448,7 @@ void SkillDialog::addSkill(const SkillOwner::Type owner,
skill->sp = sp;
skill->update();
skill->useButton = _("Use");
+ skill->errorText = name;
mDefaultModel->addSkill(skill);
mSkills[id] = skill;