summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-06 15:48:47 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-06 15:48:47 +0300
commit2131a42c62c35c3b1876da1ac8dda967b93768e7 (patch)
tree37fdb236190e38db1b8d915db6ab69cdef889dc1 /src/gui
parent83a6463a88b4b5eda003f55b419995c13476d917 (diff)
downloadplus-2131a42c62c35c3b1876da1ac8dda967b93768e7.tar.gz
plus-2131a42c62c35c3b1876da1ac8dda967b93768e7.tar.bz2
plus-2131a42c62c35c3b1876da1ac8dda967b93768e7.tar.xz
plus-2131a42c62c35c3b1876da1ac8dda967b93768e7.zip
Show mana in skill popup.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/skillinfo.cpp6
-rw-r--r--src/gui/widgets/skillinfo.h1
-rw-r--r--src/gui/widgets/skilllistbox.h13
3 files changed, 18 insertions, 2 deletions
diff --git a/src/gui/widgets/skillinfo.cpp b/src/gui/widgets/skillinfo.cpp
index 29b9510ee..721c4c98e 100644
--- a/src/gui/widgets/skillinfo.cpp
+++ b/src/gui/widgets/skillinfo.cpp
@@ -38,6 +38,7 @@
SkillInfo::SkillInfo() :
skillLevel(),
skillExp(),
+ skillMana(),
useButton(),
progress(0.0F),
color(),
@@ -93,6 +94,11 @@ void SkillInfo::update()
skillLevel = strprintf(_("Lvl: %d"), baseLevel);
}
+ if (sp)
+ skillMana = strprintf(_("Mana: -%d"), sp);
+ else
+ skillMana.clear();
+
level = baseLevel;
skillLevelWidth = -1;
diff --git a/src/gui/widgets/skillinfo.h b/src/gui/widgets/skillinfo.h
index bdeac330d..06c5a8670 100644
--- a/src/gui/widgets/skillinfo.h
+++ b/src/gui/widgets/skillinfo.h
@@ -45,6 +45,7 @@ struct SkillInfo final
{
std::string skillLevel;
std::string skillExp;
+ std::string skillMana;
std::string useButton;
float progress;
Color color;
diff --git a/src/gui/widgets/skilllistbox.h b/src/gui/widgets/skilllistbox.h
index a3b6be059..97be121a8 100644
--- a/src/gui/widgets/skilllistbox.h
+++ b/src/gui/widgets/skilllistbox.h
@@ -165,11 +165,20 @@ class SkillListBox final : public ListBox
return;
const SkillInfo *const skill = getSkillByEvent(event);
- if (!skill)
+ if (!skill || !skill->data)
return;
+ std::string description = skill->data->description;
+ std::string mana = skill->skillMana;
+ if (description.empty())
+ {
+ description = mana;
+ mana.clear();
+ }
mPopup->show(viewport->mMouseX, viewport->mMouseY,
- skill->data->dispName, skill->data->description);
+ skill->data->dispName,
+ description,
+ mana);
}
void mouseDragged(MouseEvent &event)