From 34e386d0c2d4ae844d50185f70bba945960bad62 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 15 Aug 2011 02:52:07 +0300 Subject: Add warp menu item for gms in navigation items. --- src/gui/popupmenu.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/gui') 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) -- cgit v1.2.3-70-g09d2