From 06ffa695ca77de549520fa03c500c7d88f21c0c4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 23 Sep 2014 20:15:42 +0300 Subject: Add field errorText into skills. --- src/gui/windows/skilldialog.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/gui/windows') 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; -- cgit v1.2.3-70-g09d2