diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-17 14:00:25 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-17 14:00:25 +0300 |
commit | dbf6fd812e5eff87a8fc38c4f5635845493885b1 (patch) | |
tree | fd7479749b2d0b61249783b1b0d9080278a9bceb | |
parent | a9b9e09cfecc1ede11647bbbc09ddc198d783947 (diff) | |
download | mv-dbf6fd812e5eff87a8fc38c4f5635845493885b1.tar.gz mv-dbf6fd812e5eff87a8fc38c4f5635845493885b1.tar.bz2 mv-dbf6fd812e5eff87a8fc38c4f5635845493885b1.tar.xz mv-dbf6fd812e5eff87a8fc38c4f5635845493885b1.zip |
Create public variable for textpopup.
-rw-r--r-- | src/client.cpp | 2 | ||||
-rw-r--r-- | src/gui/popupmanager.cpp | 15 | ||||
-rw-r--r-- | src/gui/popupmanager.h | 3 | ||||
-rw-r--r-- | src/gui/popups/textpopup.cpp | 2 | ||||
-rw-r--r-- | src/gui/popups/textpopup.h | 2 | ||||
-rw-r--r-- | src/gui/windowmanager.cpp | 3 |
6 files changed, 15 insertions, 12 deletions
diff --git a/src/client.cpp b/src/client.cpp index 4d0317651..342f24f14 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -61,6 +61,7 @@ #include "gui/popups/beingpopup.h" #include "gui/popups/popupmenu.h" +#include "gui/popups/textpopup.h" #include "gui/windows/changeemaildialog.h" #include "gui/windows/changepassworddialog.h" @@ -607,6 +608,7 @@ void Client::gameClear() delete2(commandHandler); delete2(popupMenu); delete2(beingPopup); + delete2(textPopup); stopTimers(); diff --git a/src/gui/popupmanager.cpp b/src/gui/popupmanager.cpp index 331b34dd9..148689c7b 100644 --- a/src/gui/popupmanager.cpp +++ b/src/gui/popupmanager.cpp @@ -36,15 +36,12 @@ PopupManager *popupManager = nullptr; -PopupManager::PopupManager() : - mTextPopup(new TextPopup) +PopupManager::PopupManager() { - mTextPopup->postInit(); } PopupManager::~PopupManager() { - delete2(mTextPopup); } void PopupManager::closePopupMenu() @@ -61,8 +58,8 @@ void PopupManager::hideBeingPopup() void PopupManager::hideTextPopup() { - if (mTextPopup) - mTextPopup->setVisible(false); + if (textPopup) + textPopup->setVisible(false); } void PopupManager::hidePopupMenu() @@ -85,13 +82,13 @@ void PopupManager::clearPopup() void PopupManager::showTextPopup(const int x, const int y, const std::string &text) { - if (mTextPopup) - mTextPopup->show(x, y, text); + if (textPopup) + textPopup->show(x, y, text); } bool PopupManager::isTextPopupVisible() const { - return mTextPopup ? mTextPopup->isPopupVisible() : false; + return textPopup ? textPopup->isPopupVisible() : false; } bool PopupManager::isBeingPopupVisible() const diff --git a/src/gui/popupmanager.h b/src/gui/popupmanager.h index cdeebc63b..3c7a0026f 100644 --- a/src/gui/popupmanager.h +++ b/src/gui/popupmanager.h @@ -85,9 +85,6 @@ class PopupManager final void clearPopup(); void hidePopupMenu(); - - private: - TextPopup *mTextPopup; /**< Map Item information popup. */ }; extern PopupManager *popupManager; diff --git a/src/gui/popups/textpopup.cpp b/src/gui/popups/textpopup.cpp index 5eff7fd4a..b7e17fece 100644 --- a/src/gui/popups/textpopup.cpp +++ b/src/gui/popups/textpopup.cpp @@ -29,6 +29,8 @@ #include "debug.h" +TextPopup *textPopup = nullptr; + TextPopup::TextPopup() : Popup("TextPopup", "textpopup.xml"), mText() diff --git a/src/gui/popups/textpopup.h b/src/gui/popups/textpopup.h index c36b94838..4d8c2cc5e 100644 --- a/src/gui/popups/textpopup.h +++ b/src/gui/popups/textpopup.h @@ -78,4 +78,6 @@ class TextPopup final : public Popup Label *mText[TEXTPOPUPCOUNT]; }; +extern TextPopup *textPopup; + #endif // GUI_POPUPS_TEXTPOPUP_H diff --git a/src/gui/windowmanager.cpp b/src/gui/windowmanager.cpp index e71079533..ff060594c 100644 --- a/src/gui/windowmanager.cpp +++ b/src/gui/windowmanager.cpp @@ -34,6 +34,7 @@ #include "gui/popups/beingpopup.h" #include "gui/popups/popupmenu.h" +#include "gui/popups/textpopup.h" #include "gui/windows/didyouknowwindow.h" #include "gui/windows/helpwindow.h" @@ -99,6 +100,8 @@ void WindowManager::createWindows() popupMenu->postInit(); beingPopup = new BeingPopup; beingPopup->postInit(); + textPopup = new TextPopup; + textPopup->postInit(); } void WindowManager::initTitle() |