diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-17 16:07:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-17 16:07:24 +0300 |
commit | 8daae3e4f095a58e3cb39f203cf69e405cda70c1 (patch) | |
tree | 8c7da97bafd6107dcc86f113f6303fbbb19549b0 /src/gui | |
parent | 29402e0b1833dfc19fb646e2b7541a401ff9ffe8 (diff) | |
download | ManaVerse-8daae3e4f095a58e3cb39f203cf69e405cda70c1.tar.gz ManaVerse-8daae3e4f095a58e3cb39f203cf69e405cda70c1.tar.bz2 ManaVerse-8daae3e4f095a58e3cb39f203cf69e405cda70c1.tar.xz ManaVerse-8daae3e4f095a58e3cb39f203cf69e405cda70c1.zip |
Use public spell popup in itemshortcutcontainer.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/widgets/itemshortcutcontainer.cpp | 20 | ||||
-rw-r--r-- | src/gui/widgets/itemshortcutcontainer.h | 1 |
2 files changed, 8 insertions, 13 deletions
diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp index ba677d90e..f92fef323 100644 --- a/src/gui/widgets/itemshortcutcontainer.cpp +++ b/src/gui/widgets/itemshortcutcontainer.cpp @@ -60,14 +60,11 @@ ItemShortcutContainer::ItemShortcutContainer(Widget2 *const widget, ShortcutContainer(widget), mItemClicked(false), mNumber(number), - mSpellPopup(new SpellPopup), mEquipedColor(getThemeColor(Theme::ITEM_EQUIPPED)), mEquipedColor2(getThemeColor(Theme::ITEM_EQUIPPED_OUTLINE)), mUnEquipedColor(getThemeColor(Theme::ITEM_NOT_EQUIPPED)), mUnEquipedColor2(getThemeColor(Theme::ITEM_NOT_EQUIPPED_OUTLINE)) { - mSpellPopup->postInit(); - if (itemShortcut[mNumber]) mMaxItems = itemShortcut[mNumber]->getItemCount(); else @@ -76,7 +73,6 @@ ItemShortcutContainer::ItemShortcutContainer(Widget2 *const widget, ItemShortcutContainer::~ItemShortcutContainer() { - delete2(mSpellPopup); } void ItemShortcutContainer::setWidget2(const Widget2 *const widget) @@ -403,7 +399,7 @@ void ItemShortcutContainer::mouseMoved(MouseEvent &event) if (itemId < SPELL_MIN_ID) { - mSpellPopup->setVisible(false); + spellPopup->setVisible(false); Inventory *const inv = PlayerInfo::getInventory(); if (!inv) @@ -426,12 +422,12 @@ void ItemShortcutContainer::mouseMoved(MouseEvent &event) const TextCommand *const spell = spellManager->getSpellByItem(itemId); if (spell && viewport) { - mSpellPopup->setItem(spell); - mSpellPopup->view(viewport->getMouseX(), viewport->getMouseY()); + spellPopup->setItem(spell); + spellPopup->view(viewport->getMouseX(), viewport->getMouseY()); } else { - mSpellPopup->setVisible(false); + spellPopup->setVisible(false); } } else if (skillDialog) @@ -445,14 +441,14 @@ void ItemShortcutContainer::mouseExited(MouseEvent &event A_UNUSED) { if (itemPopup) itemPopup->setVisible(false); - if (mSpellPopup) - mSpellPopup->setVisible(false); + if (spellPopup) + spellPopup->setVisible(false); } void ItemShortcutContainer::widgetHidden(const Event &event A_UNUSED) { if (itemPopup) itemPopup->setVisible(false); - if (mSpellPopup) - mSpellPopup->setVisible(false); + if (spellPopup) + spellPopup->setVisible(false); } diff --git a/src/gui/widgets/itemshortcutcontainer.h b/src/gui/widgets/itemshortcutcontainer.h index 6c268251a..d1f959bcd 100644 --- a/src/gui/widgets/itemshortcutcontainer.h +++ b/src/gui/widgets/itemshortcutcontainer.h @@ -81,7 +81,6 @@ class ItemShortcutContainer final : public ShortcutContainer bool mItemClicked; unsigned mNumber; - SpellPopup *mSpellPopup; Color mEquipedColor; Color mEquipedColor2; Color mUnEquipedColor; |