diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-06 18:26:01 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-06 18:26:01 +0300 |
commit | 813779679c40323d29aaa6cb334210e3944d5c99 (patch) | |
tree | 60ea74121bba5113431fc9cd550bdef6ba401837 /src/gui/widgets/skilllistbox.h | |
parent | 6d57a376b3f676b79280d4109dbe5d9bb7147821 (diff) | |
download | manaverse-813779679c40323d29aaa6cb334210e3944d5c99.tar.gz manaverse-813779679c40323d29aaa6cb334210e3944d5c99.tar.bz2 manaverse-813779679c40323d29aaa6cb334210e3944d5c99.tar.xz manaverse-813779679c40323d29aaa6cb334210e3944d5c99.zip |
Use skillpopup in skills window.
Diffstat (limited to 'src/gui/widgets/skilllistbox.h')
-rw-r--r-- | src/gui/widgets/skilllistbox.h | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/src/gui/widgets/skilllistbox.h b/src/gui/widgets/skilllistbox.h index 97be121a8..5ae389d83 100644 --- a/src/gui/widgets/skilllistbox.h +++ b/src/gui/widgets/skilllistbox.h @@ -36,7 +36,7 @@ #include "gui/models/skillmodel.h" -#include "gui/popups/textpopup.h" +#include "gui/popups/skillpopup.h" #include "render/graphics.h" @@ -55,7 +55,7 @@ class SkillListBox final : public ListBox SkillModel *const model) : ListBox(widget, model, "skilllistbox.xml"), mModel(model), - mPopup(new TextPopup), + mPopup(new SkillPopup), mTextColor(getThemeColor(Theme::TEXT)), mTextColor2(getThemeColor(Theme::TEXT_OUTLINE)), mTextPadding(mSkin ? mSkin->getOption("textPadding", 34) : 34), @@ -165,20 +165,8 @@ class SkillListBox final : public ListBox return; const SkillInfo *const skill = getSkillByEvent(event); - 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, - description, - mana); + mPopup->show(skill); + mPopup->position(viewport->mMouseX, viewport->mMouseY); } void mouseDragged(MouseEvent &event) @@ -230,7 +218,7 @@ class SkillListBox final : public ListBox private: SkillModel *mModel; - TextPopup *mPopup; + SkillPopup *mPopup; Color mTextColor; Color mTextColor2; int mTextPadding; |