summaryrefslogtreecommitdiff
path: root/src/gui/windows/skilldialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-05 11:24:55 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-06 01:18:57 +0300
commit89c117a64240de90c19004c846edf7c524f6484d (patch)
tree5857766b21e849b94e81267a5054594bd5bf5f1d /src/gui/windows/skilldialog.cpp
parentfeeddcb6fe41864d862b9e36e503d3ace07eb76d (diff)
downloadmv-89c117a64240de90c19004c846edf7c524f6484d.tar.gz
mv-89c117a64240de90c19004c846edf7c524f6484d.tar.bz2
mv-89c117a64240de90c19004c846edf7c524f6484d.tar.xz
mv-89c117a64240de90c19004c846edf7c524f6484d.zip
For unknown skills use if possible server side skill name.
Diffstat (limited to 'src/gui/windows/skilldialog.cpp')
-rw-r--r--src/gui/windows/skilldialog.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp
index 0babe5d38..63451d1a1 100644
--- a/src/gui/windows/skilldialog.cpp
+++ b/src/gui/windows/skilldialog.cpp
@@ -361,7 +361,10 @@ bool SkillDialog::updateSkill(const int id, const int range,
return false;
}
-void SkillDialog::addSkill(const int id, const int level, const int range,
+void SkillDialog::addSkill(const int id,
+ const std::string &name,
+ const int level,
+ const int range,
const bool modifiable)
{
if (mDefaultModel)
@@ -369,8 +372,16 @@ void SkillDialog::addSkill(const int id, const int level, const int range,
SkillInfo *const skill = new SkillInfo;
skill->id = static_cast<unsigned int>(id);
SkillData *const data = skill->data;
- data->name = "Unknown skill Id: " + toString(id);
- data->dispName = data->name;
+ if (name.empty())
+ {
+ data->name = "Unknown skill Id: " + toString(id);
+ data->dispName = data->name;
+ }
+ else
+ {
+ data->name = name;
+ data->dispName = strprintf("%s, %u", name.c_str(), skill->id);
+ }
data->description.clear();
data->setIcon("");
skill->modifiable = modifiable;