Zoom: Add 'disabled by game or mod' message
parent
8a99c8c94a
commit
f1d2bc0965
11
src/game.cpp
11
src/game.cpp
|
@ -1280,6 +1280,7 @@ protected:
|
||||||
void increaseViewRange();
|
void increaseViewRange();
|
||||||
void decreaseViewRange();
|
void decreaseViewRange();
|
||||||
void toggleFullViewRange();
|
void toggleFullViewRange();
|
||||||
|
void checkZoomEnabled();
|
||||||
|
|
||||||
void updateCameraDirection(CameraOrientation *cam, float dtime);
|
void updateCameraDirection(CameraOrientation *cam, float dtime);
|
||||||
void updateCameraOrientation(CameraOrientation *cam, float dtime);
|
void updateCameraOrientation(CameraOrientation *cam, float dtime);
|
||||||
|
@ -2579,6 +2580,8 @@ void Game::processKeyInput()
|
||||||
decreaseViewRange();
|
decreaseViewRange();
|
||||||
} else if (wasKeyDown(KeyType::RANGESELECT)) {
|
} else if (wasKeyDown(KeyType::RANGESELECT)) {
|
||||||
toggleFullViewRange();
|
toggleFullViewRange();
|
||||||
|
} else if (wasKeyDown(KeyType::ZOOM)) {
|
||||||
|
checkZoomEnabled();
|
||||||
} else if (wasKeyDown(KeyType::QUICKTUNE_NEXT)) {
|
} else if (wasKeyDown(KeyType::QUICKTUNE_NEXT)) {
|
||||||
quicktune->next();
|
quicktune->next();
|
||||||
} else if (wasKeyDown(KeyType::QUICKTUNE_PREV)) {
|
} 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)
|
void Game::updateCameraDirection(CameraOrientation *cam, float dtime)
|
||||||
{
|
{
|
||||||
if ((device->isWindowActive() && device->isWindowFocused()
|
if ((device->isWindowActive() && device->isWindowFocused()
|
||||||
|
|
Loading…
Reference in New Issue