summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-11-22 17:10:00 +0300
committerAndrei Karas <akaras@inbox.ru>2015-11-22 17:10:00 +0300
commitc10c3b3e5ae49719a6f52873b003ef2643df3e60 (patch)
treeb3cebd6ffe37498dac85c8ea9045d5176d01c564
parente620af2dff6176252b75e219aaea356dd1d10b0c (diff)
downloadmv-c10c3b3e5ae49719a6f52873b003ef2643df3e60.tar.gz
mv-c10c3b3e5ae49719a6f52873b003ef2643df3e60.tar.bz2
mv-c10c3b3e5ae49719a6f52873b003ef2643df3e60.tar.xz
mv-c10c3b3e5ae49719a6f52873b003ef2643df3e60.zip
Add to skill selected skill level field.
-rw-r--r--src/gui/widgets/skillinfo.cpp18
-rw-r--r--src/gui/widgets/skillinfo.h1
2 files changed, 17 insertions, 2 deletions
diff --git a/src/gui/widgets/skillinfo.cpp b/src/gui/widgets/skillinfo.cpp
index 2047ea31c..bf8367689 100644
--- a/src/gui/widgets/skillinfo.cpp
+++ b/src/gui/widgets/skillinfo.cpp
@@ -46,6 +46,7 @@ SkillInfo::SkillInfo() :
model(nullptr),
data(nullptr),
level(0),
+ selectedLevel(0),
skillLevelWidth(0),
id(0),
range(0),
@@ -96,8 +97,18 @@ void SkillInfo::update()
}
else
{
- // TRANSLATORS: skill level
- skillLevel = strprintf(_("Lvl: %d"), baseLevel);
+ if (!selectedLevel)
+ {
+ // TRANSLATORS: skill level
+ skillLevel = strprintf(_("Lvl: %d"), baseLevel);
+ }
+ else
+ {
+ // TRANSLATORS: skill level
+ skillLevel = strprintf(_("Lvl: %d / %d"),
+ selectedLevel,
+ baseLevel);
+ }
}
// TRANSLATORS: skill type
@@ -156,6 +167,9 @@ void SkillInfo::update()
}
level = baseLevel;
+ if (selectedLevel > level)
+ selectedLevel = level;
+
skillLevelWidth = -1;
if (updateVisibility && model)
diff --git a/src/gui/widgets/skillinfo.h b/src/gui/widgets/skillinfo.h
index 95099db2c..55ecd004a 100644
--- a/src/gui/widgets/skillinfo.h
+++ b/src/gui/widgets/skillinfo.h
@@ -57,6 +57,7 @@ struct SkillInfo final
SkillModel *model;
SkillData *data;
int level;
+ int selectedLevel;
int skillLevelWidth;
unsigned int id;
int range;