summaryrefslogtreecommitdiff
path: root/src/gui/dialogsmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-05-20 06:11:17 +0300
committerAndrei Karas <akaras@inbox.ru>2018-05-20 06:11:17 +0300
commit3363acba6f1e8e51937ae2e354a8086c5c56b8cd (patch)
treecc2429241a3e7cba7a90ba1ae1b76e0abf8e5345 /src/gui/dialogsmanager.cpp
parent1f5ca54b8f60e112c2043160700055290c8ce912 (diff)
downloadplus-3363acba6f1e8e51937ae2e354a8086c5c56b8cd.tar.gz
plus-3363acba6f1e8e51937ae2e354a8086c5c56b8cd.tar.bz2
plus-3363acba6f1e8e51937ae2e354a8086c5c56b8cd.tar.xz
plus-3363acba6f1e8e51937ae2e354a8086c5c56b8cd.zip
Show gm revive button in death dialog if player have rights for @alive command.
Diffstat (limited to 'src/gui/dialogsmanager.cpp')
-rw-r--r--src/gui/dialogsmanager.cpp43
1 files changed, 31 insertions, 12 deletions
diff --git a/src/gui/dialogsmanager.cpp b/src/gui/dialogsmanager.cpp
index 2a4f407ee..288fadc94 100644
--- a/src/gui/dialogsmanager.cpp
+++ b/src/gui/dialogsmanager.cpp
@@ -48,6 +48,7 @@
#include "net/inventoryhandler.h"
#include "resources/db/deaddb.h"
+#include "resources/db/groupdb.h"
#include "utils/gettext.h"
@@ -57,7 +58,7 @@
#undef ERROR
#endif // WIN32
-OkDialog *deathNotice = nullptr;
+Window *deathNotice = nullptr;
DialogsManager *dialogsManager = nullptr;
OkDialog *weightNotice = nullptr;
time_t weightNoticeTime = 0;
@@ -141,17 +142,35 @@ void DialogsManager::playerDeath()
#ifndef DYECMD
if (deathNotice == nullptr)
{
- CREATEWIDGETV(deathNotice, OkDialog,
- // TRANSLATORS: message header
- _("Message"),
- DeadDB::getRandomString(),
- // TRANSLATORS: ok dialog button
- _("Revive"),
- DialogType::OK,
- Modal_false,
- ShowCenter_true,
- nullptr,
- 260);
+ if (GroupDb::isAllowCommand(ServerCommandType::alive))
+ {
+ CREATEWIDGETV(deathNotice, ConfirmDialog,
+ // TRANSLATORS: message header
+ _("Message"),
+ DeadDB::getRandomString(),
+ // TRANSLATORS: ok dialog button
+ _("Revive"),
+ // TRANSLATORS: ok dialog button
+ _("GM revive"),
+ SOUND_REQUEST,
+ false,
+ Modal_false,
+ nullptr);
+ }
+ else
+ {
+ CREATEWIDGETV(deathNotice, OkDialog,
+ // TRANSLATORS: message header
+ _("Message"),
+ DeadDB::getRandomString(),
+ // TRANSLATORS: ok dialog button
+ _("Revive"),
+ DialogType::OK,
+ Modal_false,
+ ShowCenter_true,
+ nullptr,
+ 260);
+ }
deathNotice->addActionListener(&postDeathListener);
}
#endif // DYECMD