diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-17 15:49:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-17 15:49:46 +0300 |
commit | 28072bc9da91582e5a0caec64fba880f51e5d639 (patch) | |
tree | a31932db9200562ea881f11f11f4d70a08bdf9e9 /src/gui | |
parent | df05f66206b2e1f0af1444f91d0885f331af22a6 (diff) | |
download | manaverse-28072bc9da91582e5a0caec64fba880f51e5d639.tar.gz manaverse-28072bc9da91582e5a0caec64fba880f51e5d639.tar.bz2 manaverse-28072bc9da91582e5a0caec64fba880f51e5d639.tar.xz manaverse-28072bc9da91582e5a0caec64fba880f51e5d639.zip |
Use public item popup in equipmentwindow.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/windows/equipmentwindow.cpp | 23 | ||||
-rw-r--r-- | src/gui/windows/equipmentwindow.h | 1 |
2 files changed, 10 insertions, 14 deletions
diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index 5600de741..a3f3d103f 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -63,7 +63,6 @@ EquipmentWindow::EquipmentWindow(Equipment *const equipment, Window(_("Equipment"), false, nullptr, "equipment.xml"), ActionListener(), mEquipment(equipment), - mItemPopup(new ItemPopup), mPlayerBox(new PlayerBox(this, "equipment_playerbox.xml", "equipment_selectedplayerbox.xml")), @@ -89,7 +88,6 @@ EquipmentWindow::EquipmentWindow(Equipment *const equipment, mMaxY(0), mForing(foring) { - mItemPopup->postInit(); if (setupWindow) setupWindow->registerWindowForReset(this); @@ -137,7 +135,6 @@ void EquipmentWindow::postInit() EquipmentWindow::~EquipmentWindow() { - delete2(mItemPopup); if (this == beingEquipmentWindow) { if (mEquipment) @@ -349,8 +346,8 @@ void EquipmentWindow::mousePressed(MouseEvent& event) { if (Item *const item = getItem(x, y)) { - if (mItemPopup) - mItemPopup->setVisible(false); + if (itemPopup) + itemPopup->setVisible(false); /* Convert relative to the window coordinates to absolute screen * coordinates. @@ -430,7 +427,7 @@ void EquipmentWindow::mouseMoved(MouseEvent &event) { Window::mouseMoved(event); - if (!mItemPopup) + if (!itemPopup) return; const int x = event.getX(); @@ -440,20 +437,20 @@ void EquipmentWindow::mouseMoved(MouseEvent &event) if (item) { - mItemPopup->setItem(item); - mItemPopup->position(x + getX(), y + getY()); + itemPopup->setItem(item); + itemPopup->position(x + getX(), y + getY()); } else { - mItemPopup->setVisible(false); + itemPopup->setVisible(false); } } // Hide ItemTooltip void EquipmentWindow::mouseExited(MouseEvent &event A_UNUSED) { - if (mItemPopup) - mItemPopup->setVisible(false); + if (itemPopup) + itemPopup->setVisible(false); } void EquipmentWindow::setSelected(const int index) @@ -462,8 +459,8 @@ void EquipmentWindow::setSelected(const int index) mRedraw = true; if (mUnequip) mUnequip->setEnabled(mSelected != -1); - if (mItemPopup) - mItemPopup->setVisible(false); + if (itemPopup) + itemPopup->setVisible(false); } void EquipmentWindow::setBeing(Being *const being) diff --git a/src/gui/windows/equipmentwindow.h b/src/gui/windows/equipmentwindow.h index 1f9dbcbcd..b90c39d81 100644 --- a/src/gui/windows/equipmentwindow.h +++ b/src/gui/windows/equipmentwindow.h @@ -116,7 +116,6 @@ class EquipmentWindow final : public Window, Equipment *mEquipment; - ItemPopup *mItemPopup; PlayerBox *mPlayerBox; Button *mUnequip; |