summaryrefslogtreecommitdiff
path: root/src/gui/popupmenu.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-03-04 16:32:40 +0300
committerAndrei Karas <akaras@inbox.ru>2012-03-04 16:33:19 +0300
commit8fd450f698f8277eb8348da914d3dcbc11890ea6 (patch)
treeebaddac087d5e5b29f23a2aa01dd2758c3b8f68a /src/gui/popupmenu.cpp
parentc6d7f7ed3d6d7827b820670faf6c48f0689fd5c2 (diff)
parentf74202392745923f9ce372a6bdcd0a45db6bcd08 (diff)
downloadmv-8fd450f698f8277eb8348da914d3dcbc11890ea6.tar.gz
mv-8fd450f698f8277eb8348da914d3dcbc11890ea6.tar.bz2
mv-8fd450f698f8277eb8348da914d3dcbc11890ea6.tar.xz
mv-8fd450f698f8277eb8348da914d3dcbc11890ea6.zip
Merge branch 'master' into stripped
Conflicts: configure.ac data/Makefile.am data/fonts/liberationsans-bold.ttf data/fonts/liberationsans.ttf data/fonts/liberationsansmono-bold.ttf data/fonts/liberationsansmono.ttf data/themes/redandblack/CMakeLists.txt data/themes/redandblack/Makefile.am po/cs.po po/de.po po/es.po po/fi.po po/fr.po po/id.po po/ja.po po/manaplus.pot po/nl_BE.po po/pl.po po/pt.po po/pt_BR.po po/ru.po po/zh_CN.po src/guichan/color.cpp src/guichan/defaultfont.cpp src/guichan/focushandler.cpp src/guichan/include/guichan/actionlistener.hpp src/guichan/include/guichan/deathlistener.hpp src/guichan/include/guichan/focushandler.hpp src/guichan/include/guichan/focuslistener.hpp src/guichan/include/guichan/graphics.hpp src/guichan/include/guichan/keylistener.hpp src/guichan/include/guichan/listmodel.hpp src/guichan/include/guichan/mouselistener.hpp src/guichan/include/guichan/sdl/sdlpixel.hpp src/guichan/include/guichan/widget.hpp src/guichan/include/guichan/widgetlistener.hpp src/guichan/include/guichan/widgets/listbox.hpp src/guichan/include/guichan/widgets/slider.hpp src/guichan/sdl/sdlgraphics.cpp src/guichan/sdl/sdlimage.cpp src/guichan/widgets/scrollarea.cpp src/guichan/widgets/slider.cpp src/guichan/widgets/tabbedarea.cpp src/guichan/widgets/textbox.cpp src/guichan/widgets/window.cpp src/net/manaserv/attributes.cpp src/net/manaserv/beinghandler.cpp src/net/manaserv/charhandler.cpp src/net/manaserv/gamehandler.h src/net/manaserv/inventoryhandler.cpp src/net/manaserv/inventoryhandler.h src/net/manaserv/itemhandler.cpp src/net/manaserv/loginhandler.cpp src/net/manaserv/network.cpp
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r--src/gui/popupmenu.cpp39
1 files changed, 38 insertions, 1 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index c987843d3..5e5f310dc 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -579,6 +579,25 @@ void PopupMenu::showPopup(int x, int y, MapItem *mapItem)
showPopup(x, y);
}
+void PopupMenu::showMapPopup(int x, int y, int x2, int y2)
+{
+ mX = x2;
+ mY = y2;
+
+ mBrowserBox->clearRows();
+
+ mBrowserBox->addRow(_("Map Item"));
+
+ if (player_node && player_node->isGM())
+ mBrowserBox->addRow("warp map", _("Warp"));
+ mBrowserBox->addRow("move", _("Move"));
+ mBrowserBox->addRow("movecamera", _("Move camera"));
+ mBrowserBox->addRow("##3---");
+ mBrowserBox->addRow("cancel", _("Cancel"));
+
+ showPopup(x, y);
+}
+
void PopupMenu::showOutfitsPopup(int x, int y)
{
mX = x;
@@ -1161,6 +1180,16 @@ void PopupMenu::handleLink(const std::string &link,
}
}
}
+ else if (link == "move" && (mX || mY))
+ {
+ if (player_node)
+ player_node->navigateTo(mX, mY);
+ }
+ else if (link == "movecamera" && (mX || mY))
+ {
+ if (viewport)
+ viewport->moveCameraToPosition(mX * 32, mY * 32);
+ }
else if (link == "split" && mItem)
{
ItemAmountWindow::showWindow(ItemAmountWindow::ItemSplit,
@@ -1304,6 +1333,14 @@ void PopupMenu::handleLink(const std::string &link,
mMapItem->getX(), mMapItem->getY());
}
}
+ else if (link == "warp map" && (mX || mY))
+ {
+ if (Game::instance())
+ {
+ Net::getAdminHandler()->warp(Game::instance()->getCurrentMapName(),
+ mX, mY);
+ }
+ }
else if (link == "remove map" && mMapItem)
{
if (viewport)
@@ -2205,7 +2242,7 @@ void PlayerListener::action(const gcn::ActionEvent &event)
{
std::string comment = mDialog->getText();
Being* being = actorSpriteManager->findBeingByName(
- mNick, (ActorSprite::Type)mType);
+ mNick, static_cast<ActorSprite::Type>(mType));
if (being)
being->setComment(comment);
Being::saveComment(mNick, comment, mType);