diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-10-14 15:51:23 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-10-14 15:51:23 +0300 |
commit | a4ee70af007aca5a59a923454ed340cdb6d1e080 (patch) | |
tree | ece6e48e91962ca807d1671766dfcce80f8cc28b | |
parent | 4ba35c456af28479b547f2ab2c0bd02c40c292f6 (diff) | |
download | manaplus-a4ee70af007aca5a59a923454ed340cdb6d1e080.tar.gz manaplus-a4ee70af007aca5a59a923454ed340cdb6d1e080.tar.bz2 manaplus-a4ee70af007aca5a59a923454ed340cdb6d1e080.tar.xz manaplus-a4ee70af007aca5a59a923454ed340cdb6d1e080.zip |
Add option for show why player disappeared. Can be usefull for GM's.
Located in settings / players / Log players actions (for GM)
-rw-r--r-- | src/defaults.cpp | 1 | ||||
-rw-r--r-- | src/enums/resources/notifytypes.h | 5 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_players.cpp | 4 | ||||
-rw-r--r-- | src/net/ea/beingrecv.cpp | 38 | ||||
-rw-r--r-- | src/resources/notifications.h | 20 |
5 files changed, 68 insertions, 0 deletions
diff --git a/src/defaults.cpp b/src/defaults.cpp index 3bf640f78..4c243a19c 100644 --- a/src/defaults.cpp +++ b/src/defaults.cpp @@ -383,6 +383,7 @@ DefaultsData* getConfigDefaults() AddDEF("showBadges", 1); AddDEF("tradescreenshot", false); AddDEF("skillAutotarget", true); + AddDEF("logPlayerActions", false); return configData; } diff --git a/src/enums/resources/notifytypes.h b/src/enums/resources/notifytypes.h index 6772a172a..242219fd0 100644 --- a/src/enums/resources/notifytypes.h +++ b/src/enums/resources/notifytypes.h @@ -214,6 +214,11 @@ namespace NotifyTypes DELETE_ITEM_ANALYSIS, DELETE_ITEM_UNKNOWN, DELETE_ITEM_DROPPED, + BEING_REMOVE_DIED, + BEING_REMOVE_LOGGED_OUT, + BEING_REMOVE_WARPED, + BEING_REMOVE_TRICK_DEAD, + BEING_REMOVE_UNKNOWN, TYPE_END }; diff --git a/src/gui/widgets/tabs/setup_players.cpp b/src/gui/widgets/tabs/setup_players.cpp index 2f8039b6a..a2be4cb71 100644 --- a/src/gui/widgets/tabs/setup_players.cpp +++ b/src/gui/widgets/tabs/setup_players.cpp @@ -125,6 +125,10 @@ Setup_Players::Setup_Players(const Widget2 *const widget) : "", "useDiagonalSpeed", this, "useDiagonalSpeedEvent"); // TRANSLATORS: settings option + new SetupItemCheckBox(_("Log players actions (for GM)"), + "", "logPlayerActions", this, "logPlayerActionsEvent"); + + // TRANSLATORS: settings option new SetupItemCheckBox(_("Create screenshots for each complete trades"), "", "tradescreenshot", this, "tradescreenshotEvent"); diff --git a/src/net/ea/beingrecv.cpp b/src/net/ea/beingrecv.cpp index f09979e58..cfae77247 100644 --- a/src/net/ea/beingrecv.cpp +++ b/src/net/ea/beingrecv.cpp @@ -23,13 +23,17 @@ #include "net/ea/beingrecv.h" #include "actormanager.h" +#include "configuration.h" #include "game.h" +#include "notifymanager.h" #include "party.h" #include "being/localplayer.h" #include "being/playerrelation.h" #include "being/playerrelations.h" +#include "enums/resources/notifytypes.h" + #include "enums/resources/map/mapitemtype.h" #include "gui/viewport.h" @@ -100,6 +104,40 @@ void BeingRecv::processBeingRemove(Net::MessageIn &msg) { if (socialWindow) socialWindow->updateActiveList(); + const std::string name = dstBeing->getName(); + if (!name.empty() && config.getBoolValue("logPlayerActions")) + { + switch (type) + { + case 0: + break; + case 1: + NotifyManager::notify( + NotifyTypes::BEING_REMOVE_DIED, + name); + break; + case 2: + NotifyManager::notify( + NotifyTypes::BEING_REMOVE_LOGGED_OUT, + name); + break; + case 3: + NotifyManager::notify( + NotifyTypes::BEING_REMOVE_WARPED, + name); + break; + case 4: + NotifyManager::notify( + NotifyTypes::BEING_REMOVE_TRICK_DEAD, + name); + break; + default: + NotifyManager::notify( + NotifyTypes::BEING_REMOVE_UNKNOWN, + name); + break; + } + } } actorManager->destroy(dstBeing); } diff --git a/src/resources/notifications.h b/src/resources/notifications.h index ab37a5232..250f42813 100644 --- a/src/resources/notifications.h +++ b/src/resources/notifications.h @@ -771,6 +771,26 @@ namespace NotifyManager {"delete item dropped", "", NotifyFlags::STRING}, + {"being remove died", + // TRANSLATORS: notification message + N_("Player %s died."), + NotifyFlags::STRING}, + {"being remove logged out", + // TRANSLATORS: notification message + N_("Player %s logged out."), + NotifyFlags::STRING}, + {"being remove warped", + // TRANSLATORS: notification message + N_("Player %s warped."), + NotifyFlags::STRING}, + {"being remove trick dead", + // TRANSLATORS: notification message + N_("Player %s trick dead."), + NotifyFlags::STRING}, + {"being remove unknown", + // TRANSLATORS: notification message + N_("Player %s unknown remove."), + NotifyFlags::STRING}, }; } // namespace NotifyManager #endif // RESOURCES_NOTIFICATIONS_H |