summaryrefslogtreecommitdiff
path: root/src/gui/widgets/skillinfo.cpp
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 /src/gui/widgets/skillinfo.cpp
parente620af2dff6176252b75e219aaea356dd1d10b0c (diff)
downloadplus-c10c3b3e5ae49719a6f52873b003ef2643df3e60.tar.gz
plus-c10c3b3e5ae49719a6f52873b003ef2643df3e60.tar.bz2
plus-c10c3b3e5ae49719a6f52873b003ef2643df3e60.tar.xz
plus-c10c3b3e5ae49719a6f52873b003ef2643df3e60.zip
Add to skill selected skill level field.
Diffstat (limited to 'src/gui/widgets/skillinfo.cpp')
-rw-r--r--src/gui/widgets/skillinfo.cpp18
1 files changed, 16 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)