diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-02 17:56:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-02 17:56:13 +0300 |
commit | 1003a7a74f72f17f59f4a74eacf95a1744a64506 (patch) | |
tree | 59e3dfae9c470426dea48b4b3aa221c40800072e /src/gui/dialogsmanager.cpp | |
parent | ce2e90b35291abe32c47e21569a58e9eb22cc87b (diff) | |
download | plus-1003a7a74f72f17f59f4a74eacf95a1744a64506.tar.gz plus-1003a7a74f72f17f59f4a74eacf95a1744a64506.tar.bz2 plus-1003a7a74f72f17f59f4a74eacf95a1744a64506.tar.xz plus-1003a7a74f72f17f59f4a74eacf95a1744a64506.zip |
Move death dialog showing from playerhandler.
Diffstat (limited to 'src/gui/dialogsmanager.cpp')
-rw-r--r-- | src/gui/dialogsmanager.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/gui/dialogsmanager.cpp b/src/gui/dialogsmanager.cpp index 0b515c2f3..0ef8a1582 100644 --- a/src/gui/dialogsmanager.cpp +++ b/src/gui/dialogsmanager.cpp @@ -36,8 +36,12 @@ #include "gui/windows/okdialog.h" #include "gui/windows/updaterwindow.h" +#include "listeners/playerpostdeathlistener.h" + #include "net/inventoryhandler.h" +#include "resources/db/deaddb.h" + #include "utils/gettext.h" #include "debug.h" @@ -46,7 +50,18 @@ #undef ERROR #endif -extern OkDialog *deathNotice; +OkDialog *deathNotice; +DialogsManager *dialogsManager = nullptr; + +namespace +{ + PlayerPostDeathListener postDeathListener; +} // namespace + +DialogsManager::DialogsManager() : + PlayerDeathListener() +{ +} void DialogsManager::closeDialogs() { @@ -96,3 +111,16 @@ Window *DialogsManager::openErrorDialog(const std::string &header, return dialog; } } + +void DialogsManager::playerDeath() +{ + logger->log("DialogsManager::playerDeath"); + // TRANSLATORS: message header + deathNotice = new OkDialog(_("Message"), + DeadDB::getRandomString(), + // TRANSLATORS: ok dialog button + _("Revive"), + DialogType::OK, + false, true, nullptr, 260); + deathNotice->addActionListener(&postDeathListener); +} |