summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorparamat <paramat@users.noreply.github.com>2017-12-12 09:47:43 +0000
committerparamat <mat.gregory@virginmedia.com>2017-12-14 20:59:54 +0000
commitf1d2bc096573627b2bbb1aa48e856f7a76e4790a (patch)
treee6039d13acbf91e578247d51847fc2d3a282e8d9 /src/game.cpp
parent8a99c8c94a40640c7c337278277f5c027e96f3cb (diff)
downloadminetest-f1d2bc096573627b2bbb1aa48e856f7a76e4790a.tar.gz
minetest-f1d2bc096573627b2bbb1aa48e856f7a76e4790a.tar.bz2
minetest-f1d2bc096573627b2bbb1aa48e856f7a76e4790a.zip
Zoom: Add 'disabled by game or mod' message
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 81a5f5809..f7d4164ae 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -1280,6 +1280,7 @@ protected:
void increaseViewRange();
void decreaseViewRange();
void toggleFullViewRange();
+ void checkZoomEnabled();
void updateCameraDirection(CameraOrientation *cam, float dtime);
void updateCameraOrientation(CameraOrientation *cam, float dtime);
@@ -2579,6 +2580,8 @@ void Game::processKeyInput()
decreaseViewRange();
} else if (wasKeyDown(KeyType::RANGESELECT)) {
toggleFullViewRange();
+ } else if (wasKeyDown(KeyType::ZOOM)) {
+ checkZoomEnabled();
} else if (wasKeyDown(KeyType::QUICKTUNE_NEXT)) {
quicktune->next();
} else if (wasKeyDown(KeyType::QUICKTUNE_PREV)) {
@@ -3018,6 +3021,14 @@ void Game::toggleFullViewRange()
}
+void Game::checkZoomEnabled()
+{
+ LocalPlayer *player = client->getEnv().getLocalPlayer();
+ if (player->getZoomFOV() < 0.001f)
+ showStatusTextSimple("Zoom currently disabled by game or mod");
+}
+
+
void Game::updateCameraDirection(CameraOrientation *cam, float dtime)
{
if ((device->isWindowActive() && device->isWindowFocused()