diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-17 14:30:53 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-17 14:30:53 +0300 |
commit | 5613e19f91676fddbdedb371a6fe07786268bb92 (patch) | |
tree | d799beeeee7871540bc7af3da187d5248068b70a /src/gui | |
parent | 26c97eda5cb85b253706d49afff55580ace9e5bf (diff) | |
download | manaverse-5613e19f91676fddbdedb371a6fe07786268bb92.tar.gz manaverse-5613e19f91676fddbdedb371a6fe07786268bb92.tar.bz2 manaverse-5613e19f91676fddbdedb371a6fe07786268bb92.tar.xz manaverse-5613e19f91676fddbdedb371a6fe07786268bb92.zip |
Use public text popup in characterdisplay.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/widgets/characterdisplay.cpp | 16 | ||||
-rw-r--r-- | src/gui/widgets/characterdisplay.h | 1 |
2 files changed, 6 insertions, 11 deletions
diff --git a/src/gui/widgets/characterdisplay.cpp b/src/gui/widgets/characterdisplay.cpp index b56d77f09..7429c9782 100644 --- a/src/gui/widgets/characterdisplay.cpp +++ b/src/gui/widgets/characterdisplay.cpp @@ -50,11 +50,8 @@ CharacterDisplay::CharacterDisplay(const Widget2 *const widget, WidgetListener(), mCharacter(nullptr), mPlayerBox(new PlayerBox(nullptr)), - mName(new Label(this, "wwwwwwwwwwwwwwwwwwwwwwww")), - mPopup(new TextPopup) + mName(new Label(this, "wwwwwwwwwwwwwwwwwwwwwwww")) { - mPopup->postInit(); - mPlayerBox->setActionEventId("select"); mPlayerBox->addActionListener(charSelectDialog); setActionEventId("use"); @@ -82,7 +79,6 @@ CharacterDisplay::CharacterDisplay(const Widget2 *const widget, CharacterDisplay::~CharacterDisplay() { - delete2(mPopup); } void CharacterDisplay::setCharacter(Net::Character *const character) @@ -117,17 +113,17 @@ void CharacterDisplay::update() void CharacterDisplay::widgetHidden(const Event &event A_UNUSED) { - mPopup->setVisible(false); + textPopup->setVisible(false); } void CharacterDisplay::mouseExited(MouseEvent &event A_UNUSED) { - mPopup->setVisible(false); + textPopup->setVisible(false); } void CharacterDisplay::mouseMoved(MouseEvent &event A_UNUSED) { - if (!gui) + if (!gui || !textPopup) return; int mouseX = 0; @@ -136,7 +132,7 @@ void CharacterDisplay::mouseMoved(MouseEvent &event A_UNUSED) const std::string &name = mName->getCaption(); if (!name.empty()) { - mPopup->show(mouseX, mouseY, name, strprintf(_("Level: %u"), + textPopup->show(mouseX, mouseY, name, strprintf(_("Level: %u"), static_cast<uint32_t>( mCharacter->data.mAttributes[Attributes::LEVEL])), strprintf(_("Money: %s"), Units::formatCurrency( @@ -144,7 +140,7 @@ void CharacterDisplay::mouseMoved(MouseEvent &event A_UNUSED) } else { - mPopup->setVisible(false); + textPopup->setVisible(false); } } diff --git a/src/gui/widgets/characterdisplay.h b/src/gui/widgets/characterdisplay.h index 8f9acf462..47959e365 100644 --- a/src/gui/widgets/characterdisplay.h +++ b/src/gui/widgets/characterdisplay.h @@ -89,7 +89,6 @@ class CharacterDisplay final : public Container, Net::Character *mCharacter; PlayerBox *mPlayerBox; Label *mName; - TextPopup *mPopup; }; #endif // GUI_WIDGETS_CHARACTERDISPLAY_H |