diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-07-23 02:30:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-07-23 02:30:20 +0300 |
commit | 648c85816ca9398dd9c672d5d4230bef030e0274 (patch) | |
tree | 1d897dff70e183cb8c31f558426921be8dcf6ce7 /src/gui/viewport.cpp | |
parent | 6336dabcb33ca6b4d417b352fa0b12651b6f4c57 (diff) | |
download | manaverse-648c85816ca9398dd9c672d5d4230bef030e0274.tar.gz manaverse-648c85816ca9398dd9c672d5d4230bef030e0274.tar.bz2 manaverse-648c85816ca9398dd9c672d5d4230bef030e0274.tar.xz manaverse-648c85816ca9398dd9c672d5d4230bef030e0274.zip |
move "change camera mode" option into gamemodifiers.
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r-- | src/gui/viewport.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 5a2c9cc91..8acc19ca6 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -80,7 +80,6 @@ Viewport::Viewport() : mMousePressY(0), mPixelViewX(0), mPixelViewY(0), - mCameraMode(0), mLocalWalkTime(-1), mCameraRelativeX(0), mCameraRelativeY(0), @@ -410,7 +409,7 @@ bool Viewport::openContextMenu(const MouseEvent &event) mPopupMenu->showPopup(eventX, eventY, mHoverSign); return true; } - else if (mCameraMode) + else if (settings.cameraMode) { if (!mMap) return false; @@ -1012,10 +1011,10 @@ void Viewport::toggleMapDrawType() void Viewport::toggleCameraMode() { - mCameraMode++; - if (mCameraMode > 1) - mCameraMode = 0; - if (!mCameraMode) + settings.cameraMode ++; + if (settings.cameraMode > 1) + settings.cameraMode = 0; + if (!settings.cameraMode) { mCameraRelativeX = 0; mCameraRelativeY = 0; @@ -1069,7 +1068,7 @@ void Viewport::moveCameraToActor(const int actorId, return; const Vector &actorPos = actor->getPosition(); const Vector &playerPos = player_node->getPosition(); - mCameraMode = 1; + settings.cameraMode = 1; mCameraRelativeX = static_cast<int>(actorPos.x - playerPos.x) + x; mCameraRelativeY = static_cast<int>(actorPos.y - playerPos.y) + y; } @@ -1080,7 +1079,7 @@ void Viewport::moveCameraToPosition(const int x, const int y) return; const Vector &playerPos = player_node->getPosition(); - mCameraMode = 1; + settings.cameraMode = 1; mCameraRelativeX = x - static_cast<int>(playerPos.x); mCameraRelativeY = y - static_cast<int>(playerPos.y); @@ -1088,14 +1087,14 @@ void Viewport::moveCameraToPosition(const int x, const int y) void Viewport::moveCameraRelative(const int x, const int y) { - mCameraMode = 1; + settings.cameraMode = 1; mCameraRelativeX += x; mCameraRelativeY += y; } void Viewport::returnCamera() { - mCameraMode = 0; + settings.cameraMode = 0; mCameraRelativeX = 0; mCameraRelativeY = 0; } |