From 0cf7a6a12f361faf7a2a1c01b14d6c33fe811d62 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 1 Oct 2009 19:56:50 +0300 Subject: Allow player to talk after death Mantis-issue: 938 (TMW Mantis) --- src/gui/charcreatedialog.cpp | 2 +- src/gui/okdialog.cpp | 4 ++-- src/gui/okdialog.h | 2 +- src/net/ea/playerhandler.cpp | 3 ++- src/net/manaserv/beinghandler.cpp | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gui/charcreatedialog.cpp b/src/gui/charcreatedialog.cpp index cd7949ed..3d240271 100644 --- a/src/gui/charcreatedialog.cpp +++ b/src/gui/charcreatedialog.cpp @@ -175,7 +175,7 @@ void CharCreateDialog::action(const gcn::ActionEvent &event) { new OkDialog(_("Error"), _("Your name needs to be at least 4 characters."), - this); + true, this); } } else if (event.getId() == "cancel") diff --git a/src/gui/okdialog.cpp b/src/gui/okdialog.cpp index 3693f3e9..71b96374 100644 --- a/src/gui/okdialog.cpp +++ b/src/gui/okdialog.cpp @@ -31,8 +31,8 @@ #include OkDialog::OkDialog(const std::string &title, const std::string &msg, - Window *parent): - Window(title, true, parent) + bool modal, Window *parent): + Window(title, modal, parent) { mTextBox = new TextBox; mTextBox->setEditable(false); diff --git a/src/gui/okdialog.h b/src/gui/okdialog.h index 1e0557b7..3c842309 100644 --- a/src/gui/okdialog.h +++ b/src/gui/okdialog.h @@ -42,7 +42,7 @@ class OkDialog : public Window, public gcn::ActionListener * @see Window::Window */ OkDialog(const std::string &title, const std::string &msg, - Window *parent = NULL); + bool modal = true, Window *parent = NULL); /** * Called when receiving actions from the widgets. diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp index 33a6b146..7fb4dab9 100644 --- a/src/net/ea/playerhandler.cpp +++ b/src/net/ea/playerhandler.cpp @@ -310,7 +310,8 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg) if (player_node->getHp() == 0 && !deathNotice) { deathNotice = new OkDialog(_("Message"), - randomDeathMessage()); + randomDeathMessage(), + false); deathNotice->addActionListener(&deathListener); player_node->setAction(Being::DEAD); } diff --git a/src/net/manaserv/beinghandler.cpp b/src/net/manaserv/beinghandler.cpp index 99b01090..5f9d1586 100644 --- a/src/net/manaserv/beinghandler.cpp +++ b/src/net/manaserv/beinghandler.cpp @@ -323,7 +323,7 @@ void BeingHandler::handleBeingActionChangeMessage(Net::MessageIn &msg) }; std::string message(deadMsg[rand()%13]); message.append(std::string(" ") + _("Press OK to respawn.")); - OkDialog *dlg = new OkDialog(_("You Died"), message); + OkDialog *dlg = new OkDialog(_("You Died"), message, false); dlg->addActionListener(&(ManaServ::respawnListener)); } } -- cgit v1.2.3-70-g09d2