summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-29 01:55:41 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-29 01:55:41 +0300
commit9956ff63ccfaee02ed68d0125007b90849cc1ee5 (patch)
tree0cf8ee36f9cd39471590234de1adde3d0edeaf27
parent60100c4b30f779fe8f63758f9974891e98816340 (diff)
downloadManaVerse-9956ff63ccfaee02ed68d0125007b90849cc1ee5.tar.gz
ManaVerse-9956ff63ccfaee02ed68d0125007b90849cc1ee5.tar.bz2
ManaVerse-9956ff63ccfaee02ed68d0125007b90849cc1ee5.tar.xz
ManaVerse-9956ff63ccfaee02ed68d0125007b90849cc1ee5.zip
Add chat command /partyrecall. Also add it to npc context menu.
-rw-r--r--src/actions/commands.cpp9
-rw-r--r--src/actions/commands.h1
-rw-r--r--src/dyetool/actions/commands.cpp1
-rw-r--r--src/enums/input/inputaction.h1
-rw-r--r--src/gui/popups/popupmenu.cpp22
-rw-r--r--src/input/inputactionmap.h6
-rw-r--r--src/net/adminhandler.h2
-rw-r--r--src/net/eathena/adminhandler.cpp5
-rw-r--r--src/net/eathena/adminhandler.h2
-rw-r--r--src/net/tmwa/adminhandler.cpp4
-rw-r--r--src/net/tmwa/adminhandler.h2
11 files changed, 55 insertions, 0 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index bbde5c4a8..afc1c6d80 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -1518,4 +1518,13 @@ impHandler(commandChangePartyLeader)
return true;
}
+impHandler(commandPartyRecall)
+{
+ const std::string args = event.args;
+ if (args.empty())
+ return false;
+ adminHandler->partyRecall(args);
+ return true;
+}
+
} // namespace Actions
diff --git a/src/actions/commands.h b/src/actions/commands.h
index efc436c97..76b20effd 100644
--- a/src/actions/commands.h
+++ b/src/actions/commands.h
@@ -135,6 +135,7 @@ namespace Actions
decHandler(commandNpcHide);
decHandler(commandNpcShow);
decHandler(commandChangePartyLeader);
+ decHandler(commandPartyRecall);
} // namespace Actions
#undef decHandler
diff --git a/src/dyetool/actions/commands.cpp b/src/dyetool/actions/commands.cpp
index 1f8fd5cbd..3778e2611 100644
--- a/src/dyetool/actions/commands.cpp
+++ b/src/dyetool/actions/commands.cpp
@@ -135,5 +135,6 @@ impHandlerVoid(commandNpcMove)
impHandlerVoid(commandNpcHide)
impHandlerVoid(commandNpcShow)
impHandlerVoid(commandChangePartyLeader)
+impHandlerVoid(commandPartyRecall)
} // namespace Actions
diff --git a/src/enums/input/inputaction.h b/src/enums/input/inputaction.h
index 63241a642..ba7135e05 100644
--- a/src/enums/input/inputaction.h
+++ b/src/enums/input/inputaction.h
@@ -664,6 +664,7 @@ enumStart(InputAction)
COMMAND_NPC_HIDE,
COMMAND_NPC_SHOW,
COMMAND_CHANGE_PARTY_LEADER,
+ COMMAND_PARTY_RECALL,
TOTAL
}
enumEnd(InputAction);
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 49073811d..13e54ba3e 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -1563,6 +1563,19 @@ void PopupMenu::handleLink(const std::string &link,
}
replaceAll(cmd, "'CARDS'", cards);
replaceAll(cmd, "'ECARDS'", escapeString(cards));
+ if (actorManager)
+ {
+ if (!being)
+ {
+ being = actorManager->findBeingByName(mName,
+ ActorType::Player);
+ }
+ }
+ if (being)
+ replaceAll(cmd, "'PARTY'", being->getPartyName());
+ else
+ replaceAll(cmd, "'PARTY'", "");
+
const size_t pos = cmd.find(' ');
const std::string type(cmd, 0, pos);
std::string args(cmd, pos == std::string::npos ? cmd.size() : pos + 1);
@@ -2756,6 +2769,15 @@ void PopupMenu::showPlayerGMCommands(const std::string &name)
mBrowserBox->addRow("/alive 'NAME'", _("Revive"));
if (!legacy)
{
+ Being *const being = actorManager->findBeingByName(name,
+ ActorType::Player);
+ if (being && !being->getPartyName().empty())
+ {
+ mBrowserBox->addRow("/partyrecall 'PARTY'",
+ // TRANSLATORS: popup menu item
+ // TRANSLATORS: recall all party to player location
+ _("Recall party"));
+ }
if (localPlayer && localPlayer->isInParty())
{
const Party *const party = localPlayer->getParty();
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index 90fb66f8c..0fb223d53 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -5473,6 +5473,12 @@ static const InputActionData inputActionData
"gmpartyleader|changepartyleader",
UseArgs_true,
Protected_true},
+ {"keyCommandPartyRecall",
+ defaultAction(&Actions::commandPartyRecall),
+ InputCondition::INGAME,
+ "partyrecall|recallparty",
+ UseArgs_true,
+ Protected_true},
};
#undef defaultAction
diff --git a/src/net/adminhandler.h b/src/net/adminhandler.h
index da919e25c..878e24782 100644
--- a/src/net/adminhandler.h
+++ b/src/net/adminhandler.h
@@ -172,6 +172,8 @@ class AdminHandler notfinal
virtual void showNpc(const std::string &name) const = 0;
virtual void changePartyLeader(const std::string &name) const = 0;
+
+ virtual void partyRecall(const std::string &name) const = 0;
};
} // namespace Net
diff --git a/src/net/eathena/adminhandler.cpp b/src/net/eathena/adminhandler.cpp
index 07b99347e..29e346af8 100644
--- a/src/net/eathena/adminhandler.cpp
+++ b/src/net/eathena/adminhandler.cpp
@@ -352,4 +352,9 @@ void AdminHandler::changePartyLeader(const std::string &name) const
Gm::runCommand("changeleader", name);
}
+void AdminHandler::partyRecall(const std::string &name) const
+{
+ Gm::runCommand("partyrecall", name);
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/adminhandler.h b/src/net/eathena/adminhandler.h
index 756f60187..c34e6d049 100644
--- a/src/net/eathena/adminhandler.h
+++ b/src/net/eathena/adminhandler.h
@@ -148,6 +148,8 @@ class AdminHandler final : public Ea::AdminHandler
void changePartyLeader(const std::string &name) const override final;
+ void partyRecall(const std::string &name) const override final;
+
protected:
static std::string mStatsName;
};
diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp
index 4ae9e5346..88c9683fe 100644
--- a/src/net/tmwa/adminhandler.cpp
+++ b/src/net/tmwa/adminhandler.cpp
@@ -275,4 +275,8 @@ void AdminHandler::changePartyLeader(const std::string &name A_UNUSED) const
{
}
+void AdminHandler::partyRecall(const std::string &name A_UNUSED) const
+{
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/adminhandler.h b/src/net/tmwa/adminhandler.h
index 069913ab8..5d43c14ff 100644
--- a/src/net/tmwa/adminhandler.h
+++ b/src/net/tmwa/adminhandler.h
@@ -161,6 +161,8 @@ class AdminHandler final : public Ea::AdminHandler
void changePartyLeader(const std::string &name) const override final
A_CONST;
+
+ void partyRecall(const std::string &name) const override final A_CONST;
};
} // namespace TmwAthena