From 89c117a64240de90c19004c846edf7c524f6484d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 5 Sep 2014 11:24:55 +0300 Subject: For unknown skills use if possible server side skill name. --- src/gui/windows/skilldialog.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/gui/windows/skilldialog.cpp') 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(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; -- cgit v1.2.3-70-g09d2