diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-17 13:47:55 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-17 13:47:55 +0300 |
commit | d0d0ddfeb0bd6cb199e3ac571c876d6bbaaf4b42 (patch) | |
tree | 578d99ea41b1eeea6068500fe0bea485bbcbccb5 /src/gui | |
parent | 2cb9f5c3d47077a459fabf15800b1c45cfdacb3a (diff) | |
download | manaverse-d0d0ddfeb0bd6cb199e3ac571c876d6bbaaf4b42.tar.gz manaverse-d0d0ddfeb0bd6cb199e3ac571c876d6bbaaf4b42.tar.bz2 manaverse-d0d0ddfeb0bd6cb199e3ac571c876d6bbaaf4b42.tar.xz manaverse-d0d0ddfeb0bd6cb199e3ac571c876d6bbaaf4b42.zip |
Create public variable for beingpopup.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/popupmanager.cpp | 13 | ||||
-rw-r--r-- | src/gui/popupmanager.h | 1 | ||||
-rw-r--r-- | src/gui/popups/beingpopup.cpp | 2 | ||||
-rw-r--r-- | src/gui/popups/beingpopup.h | 2 | ||||
-rw-r--r-- | src/gui/windowmanager.cpp | 3 |
5 files changed, 12 insertions, 9 deletions
diff --git a/src/gui/popupmanager.cpp b/src/gui/popupmanager.cpp index dc9bdc32f..429958e5c 100644 --- a/src/gui/popupmanager.cpp +++ b/src/gui/popupmanager.cpp @@ -37,16 +37,13 @@ PopupManager *popupManager = nullptr; PopupManager::PopupManager() : - mBeingPopup(new BeingPopup), mTextPopup(new TextPopup) { - mBeingPopup->postInit(); mTextPopup->postInit(); } PopupManager::~PopupManager() { - delete2(mBeingPopup); delete2(mTextPopup); } @@ -58,8 +55,8 @@ void PopupManager::closePopupMenu() void PopupManager::hideBeingPopup() { - if (mBeingPopup) - mBeingPopup->setVisible(false); + if (beingPopup) + beingPopup->setVisible(false); } void PopupManager::hideTextPopup() @@ -88,8 +85,8 @@ void PopupManager::clearPopup() void PopupManager::showBeingPopup(const int x, const int y, Being *const b) { - if (mBeingPopup) - mBeingPopup->show(x, y, b); + if (beingPopup) + beingPopup->show(x, y, b); } void PopupManager::showTextPopup(const int x, const int y, @@ -106,5 +103,5 @@ bool PopupManager::isTextPopupVisible() const bool PopupManager::isBeingPopupVisible() const { - return mBeingPopup ? mBeingPopup->isPopupVisible() : false; + return beingPopup ? beingPopup->isPopupVisible() : false; } diff --git a/src/gui/popupmanager.h b/src/gui/popupmanager.h index ae96eac94..ef82e1d8e 100644 --- a/src/gui/popupmanager.h +++ b/src/gui/popupmanager.h @@ -90,7 +90,6 @@ class PopupManager final void hidePopupMenu(); private: - BeingPopup *mBeingPopup; /**< Being information popup. */ TextPopup *mTextPopup; /**< Map Item information popup. */ }; diff --git a/src/gui/popups/beingpopup.cpp b/src/gui/popups/beingpopup.cpp index b15ccc7ae..089e51ea0 100644 --- a/src/gui/popups/beingpopup.cpp +++ b/src/gui/popups/beingpopup.cpp @@ -35,6 +35,8 @@ #include "debug.h" +BeingPopup *beingPopup = nullptr; + BeingPopup::BeingPopup() : Popup("BeingPopup", "beingpopup.xml"), mBeingName(new Label(this, "A")), diff --git a/src/gui/popups/beingpopup.h b/src/gui/popups/beingpopup.h index 76789dbea..449d36bc3 100644 --- a/src/gui/popups/beingpopup.h +++ b/src/gui/popups/beingpopup.h @@ -64,4 +64,6 @@ class BeingPopup final : public Popup Label *mBeingComment; }; +extern BeingPopup *beingPopup; + #endif // GUI_POPUPS_BEINGPOPUP_H diff --git a/src/gui/windowmanager.cpp b/src/gui/windowmanager.cpp index 3864a8990..e71079533 100644 --- a/src/gui/windowmanager.cpp +++ b/src/gui/windowmanager.cpp @@ -32,6 +32,7 @@ #include "gui/gui.h" #include "gui/userpalette.h" +#include "gui/popups/beingpopup.h" #include "gui/popups/popupmenu.h" #include "gui/windows/didyouknowwindow.h" @@ -96,6 +97,8 @@ void WindowManager::createWindows() commandHandler = new CommandHandler; popupMenu = new PopupMenu; popupMenu->postInit(); + beingPopup = new BeingPopup; + beingPopup->postInit(); } void WindowManager::initTitle() |