summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/skilldialog.cpp17
-rw-r--r--src/gui/windows/skilldialog.h5
2 files changed, 18 insertions, 4 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;
diff --git a/src/gui/windows/skilldialog.h b/src/gui/windows/skilldialog.h
index 394679d1b..e82faef05 100644
--- a/src/gui/windows/skilldialog.h
+++ b/src/gui/windows/skilldialog.h
@@ -75,7 +75,10 @@ class SkillDialog final : public Window,
bool updateSkill(const int id, const int range, const bool modifiable);
- void addSkill(const int id, const int level, const int range,
+ void addSkill(const int id,
+ const std::string &name,
+ const int level,
+ const int range,
const bool modifiable);
SkillInfo* getSkill(const int id) const A_WARN_UNUSED;