summaryrefslogtreecommitdiff
path: root/src/gui/popupmenu.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-08-15 02:52:07 +0300
committerAndrei Karas <akaras@inbox.ru>2011-08-15 02:52:07 +0300
commit34e386d0c2d4ae844d50185f70bba945960bad62 (patch)
tree96b2d1e4ab38dbc7b061006c3d3382f35af4a739 /src/gui/popupmenu.cpp
parent47f0e16e34cf22701b7c0670297bb7288a55310d (diff)
downloadmv-34e386d0c2d4ae844d50185f70bba945960bad62.tar.gz
mv-34e386d0c2d4ae844d50185f70bba945960bad62.tar.bz2
mv-34e386d0c2d4ae844d50185f70bba945960bad62.tar.xz
mv-34e386d0c2d4ae844d50185f70bba945960bad62.zip
Add warp menu item for gms in navigation items.
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r--src/gui/popupmenu.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index c95864396..a7c008684 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -502,6 +502,11 @@ void PopupMenu::showPopup(int x, int y, MapItem *mapItem)
mBrowserBox->addRow(strprintf("@@rename map|%s@@", _("Rename")));
mBrowserBox->addRow(strprintf("@@remove map|%s@@", _("Remove")));
+ if (player_node && player_node->isGM())
+ {
+ mBrowserBox->addRow("##3---");
+ mBrowserBox->addRow(strprintf("@@warp map|%s@@", _("Warp")));
+ }
mBrowserBox->addRow("##3---");
mBrowserBox->addRow(strprintf("@@cancel|%s@@", _("Cancel")));
@@ -1144,6 +1149,14 @@ void PopupMenu::handleLink(const std::string &link,
if (chatWindow)
chatWindow->clearTab();
}
+ else if (link == "warp map" && mMapItem)
+ {
+ if (Game::instance())
+ {
+ Net::getAdminHandler()->warp(Game::instance()->getCurrentMapName(),
+ mMapItem->getX(), mMapItem->getY());
+ }
+ }
else if (link == "remove map" && mMapItem)
{
if (viewport)