summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-05-25 22:25:26 +0300
committerAndrei Karas <akaras@inbox.ru>2017-05-25 22:25:26 +0300
commit0f49c02c2813ce853a7699b673103c8ef5edc05d (patch)
tree5b34aa7ad1a09baa115b6a0b83eb9676969afee4 /src
parent11bab6c211e60bfa7e50cf3de10429c1feaf9547 (diff)
downloadmv-0f49c02c2813ce853a7699b673103c8ef5edc05d.tar.gz
mv-0f49c02c2813ce853a7699b673103c8ef5edc05d.tar.bz2
mv-0f49c02c2813ce853a7699b673103c8ef5edc05d.tar.xz
mv-0f49c02c2813ce853a7699b673103c8ef5edc05d.zip
Add chat command for warp to player.
Diffstat (limited to 'src')
-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.cpp6
-rw-r--r--src/input/inputactionmap.h6
6 files changed, 19 insertions, 5 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index ebf4413e1..08c1fcbba 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -1438,6 +1438,15 @@ impHandler(commandGotoNpc)
return true;
}
+impHandler(commandGotoPc)
+{
+ const std::string args = event.args;
+ if (args.empty())
+ return false;
+ adminHandler->gotoName(args);
+ return true;
+}
+
impHandler(commandKiller)
{
adminHandler->killer(event.args);
diff --git a/src/actions/commands.h b/src/actions/commands.h
index c323bd84a..ed4deb9f5 100644
--- a/src/actions/commands.h
+++ b/src/actions/commands.h
@@ -123,6 +123,7 @@ namespace Actions
decHandler(commandLoadPosition);
decHandler(commandRandomWarp);
decHandler(commandGotoNpc);
+ decHandler(commandGotoPc);
decHandler(commandKiller);
decHandler(commandKillable);
decHandler(commandHeal);
diff --git a/src/dyetool/actions/commands.cpp b/src/dyetool/actions/commands.cpp
index bb467671b..522ead2f2 100644
--- a/src/dyetool/actions/commands.cpp
+++ b/src/dyetool/actions/commands.cpp
@@ -123,6 +123,7 @@ impHandlerVoid(commandSavePosition)
impHandlerVoid(commandLoadPosition)
impHandlerVoid(commandRandomWarp)
impHandlerVoid(commandGotoNpc)
+impHandlerVoid(commandGotoPc)
impHandlerVoid(commandKiller)
impHandlerVoid(commandKillable)
impHandlerVoid(commandHeal)
diff --git a/src/enums/input/inputaction.h b/src/enums/input/inputaction.h
index 0ffde0bd7..094102f2c 100644
--- a/src/enums/input/inputaction.h
+++ b/src/enums/input/inputaction.h
@@ -697,6 +697,7 @@ enumStart(InputAction)
COMMAND_SEND_CHARS,
CLEAR_OUTFIT,
CLIPBOARD_COPY,
+ COMMAND_GOTO_PC,
TOTAL
}
enumEnd(InputAction);
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 1d568d0d6..6b3aaf68a 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -1253,10 +1253,6 @@ void PopupMenu::handleLink(const std::string &link,
if (mTextField)
mTextField->handlePaste();
}
- else if (link == "goto" && !mName.empty())
- {
- adminHandler->gotoName(mName);
- }
else if (link == "recall" && !mName.empty())
{
adminHandler->recallName(mName);
@@ -2812,7 +2808,7 @@ void PopupMenu::showPlayerGMCommands(const std::string &name)
}
// TRANSLATORS: popup menu item
// TRANSLATORS: go to player position
- mBrowserBox->addRow("goto", _("Goto"));
+ mBrowserBox->addRow("/gotopc 'NAME'", _("Goto"));
// TRANSLATORS: popup menu item
// TRANSLATORS: recall player to current position
mBrowserBox->addRow("recall", _("Recall"));
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index d3f36d21c..e42e659d8 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -5672,6 +5672,12 @@ static const InputActionData inputActionData
"clipboardcopy|copyclipboard",
UseArgs_true,
Protected_true},
+ {"keyGotoPc",
+ defaultAction(&Actions::commandGotoPc),
+ InputCondition::INGAME,
+ "goto|gotopc",
+ UseArgs_true,
+ Protected_true},
};
#undef defaultAction