From c26b6e2c74750c1f4f99ef5d673ea6fc2aac767b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 2 Dec 2014 12:53:06 +0300 Subject: Rename PlayerDeathListener into PlayerPostDeathListener. --- src/CMakeLists.txt | 2 +- src/Makefile.am | 2 +- src/listeners/playerdeathlistener.h | 63 --------------------------------- src/listeners/playerpostdeathlistener.h | 63 +++++++++++++++++++++++++++++++++ src/net/ea/playerhandler.cpp | 6 ++-- 5 files changed, 68 insertions(+), 68 deletions(-) delete mode 100644 src/listeners/playerdeathlistener.h create mode 100644 src/listeners/playerpostdeathlistener.h (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7b704787e..4b0805bae 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1114,7 +1114,7 @@ SET(SRCS listeners/openurllistener.h listeners/pincodelistener.cpp listeners/pincodelistener.h - listeners/playerdeathlistener.h + listeners/playerpostdeathlistener.h listeners/playerlistener.cpp listeners/playerlistener.h gui/rect.h diff --git a/src/Makefile.am b/src/Makefile.am index 2660d26bb..fdbf00bd5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -205,7 +205,7 @@ manaplus_SOURCES += events/actionevent.h \ listeners/openurllistener.h \ listeners/pincodelistener.cpp \ listeners/pincodelistener.h \ - listeners/playerdeathlistener.h \ + listeners/playerpostdeathlistener.h \ listeners/playerlistener.cpp \ listeners/playerlistener.h \ gui/rect.h \ diff --git a/src/listeners/playerdeathlistener.h b/src/listeners/playerdeathlistener.h deleted file mode 100644 index 9f7974ae2..000000000 --- a/src/listeners/playerdeathlistener.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2014 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef LISTENERS_PLAYERDEATHLISTENER_H -#define LISTENERS_PLAYERDEATHLISTENER_H - -#include "being/localplayer.h" - -#include "gui/dialogsmanager.h" -#include "gui/popupmanager.h" - -#include "gui/windows/okdialog.h" -#include "gui/windows/npcdialog.h" - -#include "net/net.h" -#include "net/playerhandler.h" - -#include "localconsts.h" - -extern OkDialog *deathNotice; - -/** - * Listener used for handling death message. - */ -struct PlayerDeathListener final : public ActionListener -{ - void action(const ActionEvent &event A_UNUSED) - { - if (playerHandler) - playerHandler->respawn(); - deathNotice = nullptr; - - DialogsManager::closeDialogs(); - - if (popupManager) - popupManager->closePopupMenu(); - - NpcDialog::clearDialogs(); - if (localPlayer) - localPlayer->respawn(); - } -}; - -#endif // LISTENERS_PLAYERDEATHLISTENER_H diff --git a/src/listeners/playerpostdeathlistener.h b/src/listeners/playerpostdeathlistener.h new file mode 100644 index 000000000..6ab8fd25b --- /dev/null +++ b/src/listeners/playerpostdeathlistener.h @@ -0,0 +1,63 @@ +/* + * The ManaPlus Client + * Copyright (C) 2004-2009 The Mana World Development Team + * Copyright (C) 2009-2010 The Mana Developers + * Copyright (C) 2011-2014 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef LISTENERS_PLAYERDEATHLISTENER_H +#define LISTENERS_PLAYERDEATHLISTENER_H + +#include "being/localplayer.h" + +#include "gui/dialogsmanager.h" +#include "gui/popupmanager.h" + +#include "gui/windows/okdialog.h" +#include "gui/windows/npcdialog.h" + +#include "net/net.h" +#include "net/playerhandler.h" + +#include "localconsts.h" + +extern OkDialog *deathNotice; + +/** + * Listener used for handling death message. + */ +struct PlayerPostDeathListener final : public ActionListener +{ + void action(const ActionEvent &event A_UNUSED) + { + if (playerHandler) + playerHandler->respawn(); + deathNotice = nullptr; + + DialogsManager::closeDialogs(); + + if (popupManager) + popupManager->closePopupMenu(); + + NpcDialog::clearDialogs(); + if (localPlayer) + localPlayer->respawn(); + } +}; + +#endif // LISTENERS_PLAYERDEATHLISTENER_H diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp index baea3b1e6..940b629d4 100644 --- a/src/net/ea/playerhandler.cpp +++ b/src/net/ea/playerhandler.cpp @@ -45,7 +45,7 @@ #include "resources/map/map.h" -#include "listeners/playerdeathlistener.h" +#include "listeners/playerpostdeathlistener.h" #include "listeners/weightlistener.h" #include "net/messagein.h" @@ -65,7 +65,7 @@ static const int MAP_TELEPORT_SCROLL_DISTANCE = 8; namespace { WeightListener weightListener; - PlayerDeathListener deathListener; + PlayerPostDeathListener postDeathListener; } // anonymous namespace namespace Ea @@ -196,7 +196,7 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg) _("Revive"), DialogType::OK, false, true, nullptr, 260); - deathNotice->addActionListener(&deathListener); + deathNotice->addActionListener(&postDeathListener); if (localPlayer->getCurrentAction() != BeingAction::DEAD) { localPlayer->setAction(BeingAction::DEAD, 0); -- cgit v1.2.3-60-g2f50