summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-11-13 19:20:00 +0300
committerAndrei Karas <akaras@inbox.ru>2015-11-13 19:20:00 +0300
commit80b8d209216bbe5aa61f6b9b3ad5142197abf10c (patch)
tree20f3517204843d3d10c7abbeef3c5489f9a31b85
parente0ffa76b8c20450a32c94ae9c96b58c5f7c0ccfa (diff)
downloadplus-80b8d209216bbe5aa61f6b9b3ad5142197abf10c.tar.gz
plus-80b8d209216bbe5aa61f6b9b3ad5142197abf10c.tar.bz2
plus-80b8d209216bbe5aa61f6b9b3ad5142197abf10c.tar.xz
plus-80b8d209216bbe5aa61f6b9b3ad5142197abf10c.zip
Use global skillPopup variable for show skill popups.
-rw-r--r--src/gui/widgets/skilllistbox.h9
-rw-r--r--src/gui/windowmanager.cpp3
2 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/widgets/skilllistbox.h b/src/gui/widgets/skilllistbox.h
index 62848a98e..b386b4851 100644
--- a/src/gui/widgets/skilllistbox.h
+++ b/src/gui/widgets/skilllistbox.h
@@ -52,7 +52,6 @@ class SkillListBox final : public ListBox
SkillModel *const model) :
ListBox(widget, model, "skilllistbox.xml"),
mModel(model),
- mPopup(CREATEWIDGETR0(SkillPopup)),
mTextColor(getThemeColor(ThemeColorId::TEXT)),
mTextColor2(getThemeColor(ThemeColorId::TEXT_OUTLINE)),
mCooldownColor(getThemeColor(ThemeColorId::SKILL_COOLDOWN)),
@@ -72,7 +71,6 @@ class SkillListBox final : public ListBox
~SkillListBox()
{
delete2(mModel)
- delete2(mPopup)
}
SkillInfo *getSelectedInfo() const
@@ -197,8 +195,8 @@ class SkillListBox final : public ListBox
return;
const SkillInfo *const skill = getSkillByEvent(event);
- mPopup->show(skill);
- mPopup->position(viewport->mMouseX, viewport->mMouseY);
+ skillPopup->show(skill);
+ skillPopup->position(viewport->mMouseX, viewport->mMouseY);
}
void mouseDragged(MouseEvent &event) override final
@@ -245,12 +243,11 @@ class SkillListBox final : public ListBox
void mouseExited(MouseEvent &event A_UNUSED) override final
{
- mPopup->hide();
+ skillPopup->hide();
}
private:
SkillModel *mModel;
- SkillPopup *mPopup;
Color mTextColor;
Color mTextColor2;
Color mCooldownColor;
diff --git a/src/gui/windowmanager.cpp b/src/gui/windowmanager.cpp
index 01cc2c670..72cc677e8 100644
--- a/src/gui/windowmanager.cpp
+++ b/src/gui/windowmanager.cpp
@@ -38,6 +38,7 @@
#include "gui/popups/beingpopup.h"
#include "gui/popups/itempopup.h"
#include "gui/popups/popupmenu.h"
+#include "gui/popups/skillpopup.h"
#include "gui/popups/spellpopup.h"
#include "gui/popups/textboxpopup.h"
@@ -107,6 +108,7 @@ void WindowManager::createWindows()
CREATEWIDGETV0(textBoxPopup, TextBoxPopup);
CREATEWIDGETV0(itemPopup, ItemPopup);
CREATEWIDGETV0(spellPopup, SpellPopup);
+ CREATEWIDGETV0(skillPopup, SkillPopup);
#endif
CREATEWIDGETV0(textPopup, TextPopup);
}
@@ -118,6 +120,7 @@ void WindowManager::deleteWindows()
delete2(beingPopup);
delete2(itemPopup);
delete2(spellPopup);
+ delete2(skillPopup);
delete2(popupMenu);
delete2(didYouKnowWindow);
delete2(helpWindow);