From e70d551884c0e11408176086a25d359987090003 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 29 Feb 2012 04:53:49 +0300 Subject: Allow open conext menu from free tile if in free camera mode. Menu is same as in minimap. --- src/gui/viewport.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/gui') 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(mPixelViewX); const int pixelY = event.getY() + static_cast(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 -- cgit v1.2.3-70-g09d2