summaryrefslogtreecommitdiff
path: root/src/gui/dialogsmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/dialogsmanager.cpp')
-rw-r--r--src/gui/dialogsmanager.cpp30
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);
+}