diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-02-29 04:53:49 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-02-29 04:54:12 +0300 |
commit | e70d551884c0e11408176086a25d359987090003 (patch) | |
tree | b24bf60781ffa5ce188b268445fdecc125e35fe6 /src | |
parent | 8e6dd0db3a9e1bfb15068098029c25c334ca8f67 (diff) | |
download | manaplus-e70d551884c0e11408176086a25d359987090003.tar.gz manaplus-e70d551884c0e11408176086a25d359987090003.tar.bz2 manaplus-e70d551884c0e11408176086a25d359987090003.tar.xz manaplus-e70d551884c0e11408176086a25d359987090003.zip |
Allow open conext menu from free tile if in free camera mode.
Menu is same as in minimap.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/viewport.cpp | 9 | ||||
-rw-r--r-- | src/net/ea/playerhandler.cpp | 6 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 17f40121e..1ef7b1cba 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -413,7 +413,6 @@ void Viewport::mousePressed(gcn::MouseEvent &event) return; // Check if we are alive and kickin' -// if (!mMap || !player_node || !player_node->isAlive()) if (!mMap || !player_node) return; @@ -422,7 +421,6 @@ void Viewport::mousePressed(gcn::MouseEvent &event) if (Being::isTalking()) return; - const int pixelX = event.getX() + static_cast<int>(mPixelViewX); const int pixelY = event.getY() + static_cast<int>(mPixelViewY); @@ -461,6 +459,13 @@ void Viewport::mousePressed(gcn::MouseEvent &event) mPopupMenu->showPopup(event.getX(), event.getY(), mHoverSign); return; } + else if (mCameraMode) + { + mPopupMenu->showMapPopup(event.getX(), event.getY(), + (getMouseX() + getCameraX()) / mMap->getTileWidth(), + (getMouseY() + getCameraY()) / mMap->getTileHeight()); + return; + } } // If a popup is active, just remove it diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp index ddcf7d9c0..df28b4c1c 100644 --- a/src/net/ea/playerhandler.cpp +++ b/src/net/ea/playerhandler.cpp @@ -28,6 +28,7 @@ #include "playerinfo.h" #include "units.h" +#include "gui/ministatuswindow.h" #include "gui/okdialog.h" #include "gui/skilldialog.h" #include "gui/statuswindow.h" @@ -257,7 +258,12 @@ void PlayerHandler::processPlayerWarp(Net::MessageIn &msg) static_cast<int>(scrollOffsetY)); if (viewport) + { + viewport->returnCamera(); + if (miniStatusWindow) + miniStatusWindow->updateStatus(); viewport->scrollBy(scrollOffsetX, scrollOffsetY); + } } void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg) |