diff options
author | Reid <reidyaro@gmail.com> | 2012-03-01 22:03:01 +0100 |
---|---|---|
committer | Reid <reidyaro@gmail.com> | 2012-03-01 22:03:01 +0100 |
commit | 490862919d79369112c75955a9c36ff8a081efd3 (patch) | |
tree | 6fe89466b9c53ba811f298174e6d787bbae71e09 /src/gui/popupmenu.cpp | |
parent | dff814619d63496acd3c4e8730b828b5d4d931fb (diff) | |
parent | d873da3e8e57480016596f714845c1bc7e712e68 (diff) | |
download | plus-490862919d79369112c75955a9c36ff8a081efd3.tar.gz plus-490862919d79369112c75955a9c36ff8a081efd3.tar.bz2 plus-490862919d79369112c75955a9c36ff8a081efd3.tar.xz plus-490862919d79369112c75955a9c36ff8a081efd3.zip |
Merge branch 'master' of gitorious.org:manaplus/manaplus
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r-- | src/gui/popupmenu.cpp | 39 |
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); |