mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Change some keys to be triggered once every key press (#13883)
Those keys are below: - KeyType::CAMERA_MODE - KeyType::SCREENSHOT - KeyType::TOGGLE_BLOCK_BOUNDS - KeyType::TOGGLE_HUD - KeyType::MINIMAP - KeyType::TOGGLE_CHAT - KeyType::TOGGLE_FOG - KeyType::TOGGLE_DEBUG - KeyType::TOGGLE_PROFILER - KeyType::RANGESELECT Co-authored-by: Gregor Parzefall <82708541+grorp@users.noreply.github.com>
This commit is contained in:
parent
8a9855241c
commit
c9655e54ce
@ -2066,29 +2066,29 @@ void Game::processKeyInput()
|
||||
#endif
|
||||
} else if (wasKeyDown(KeyType::CINEMATIC)) {
|
||||
toggleCinematic();
|
||||
} else if (wasKeyDown(KeyType::SCREENSHOT)) {
|
||||
} else if (wasKeyPressed(KeyType::SCREENSHOT)) {
|
||||
client->makeScreenshot();
|
||||
} else if (wasKeyDown(KeyType::TOGGLE_BLOCK_BOUNDS)) {
|
||||
} else if (wasKeyPressed(KeyType::TOGGLE_BLOCK_BOUNDS)) {
|
||||
toggleBlockBounds();
|
||||
} else if (wasKeyDown(KeyType::TOGGLE_HUD)) {
|
||||
} else if (wasKeyPressed(KeyType::TOGGLE_HUD)) {
|
||||
m_game_ui->toggleHud();
|
||||
} else if (wasKeyDown(KeyType::MINIMAP)) {
|
||||
} else if (wasKeyPressed(KeyType::MINIMAP)) {
|
||||
toggleMinimap(isKeyDown(KeyType::SNEAK));
|
||||
} else if (wasKeyDown(KeyType::TOGGLE_CHAT)) {
|
||||
} else if (wasKeyPressed(KeyType::TOGGLE_CHAT)) {
|
||||
m_game_ui->toggleChat(client);
|
||||
} else if (wasKeyDown(KeyType::TOGGLE_FOG)) {
|
||||
} else if (wasKeyPressed(KeyType::TOGGLE_FOG)) {
|
||||
toggleFog();
|
||||
} else if (wasKeyDown(KeyType::TOGGLE_UPDATE_CAMERA)) {
|
||||
toggleUpdateCamera();
|
||||
} else if (wasKeyDown(KeyType::TOGGLE_DEBUG)) {
|
||||
} else if (wasKeyPressed(KeyType::TOGGLE_DEBUG)) {
|
||||
toggleDebug();
|
||||
} else if (wasKeyDown(KeyType::TOGGLE_PROFILER)) {
|
||||
} else if (wasKeyPressed(KeyType::TOGGLE_PROFILER)) {
|
||||
m_game_ui->toggleProfiler();
|
||||
} else if (wasKeyDown(KeyType::INCREASE_VIEWING_RANGE)) {
|
||||
increaseViewRange();
|
||||
} else if (wasKeyDown(KeyType::DECREASE_VIEWING_RANGE)) {
|
||||
decreaseViewRange();
|
||||
} else if (wasKeyDown(KeyType::RANGESELECT)) {
|
||||
} else if (wasKeyPressed(KeyType::RANGESELECT)) {
|
||||
toggleFullViewRange();
|
||||
} else if (wasKeyDown(KeyType::ZOOM)) {
|
||||
checkZoomEnabled();
|
||||
@ -3138,7 +3138,7 @@ void Game::updateCamera(f32 dtime)
|
||||
|
||||
v3s16 old_camera_offset = camera->getOffset();
|
||||
|
||||
if (wasKeyDown(KeyType::CAMERA_MODE)) {
|
||||
if (wasKeyPressed(KeyType::CAMERA_MODE)) {
|
||||
GenericCAO *playercao = player->getCAO();
|
||||
|
||||
// If playercao not loaded, don't change camera
|
||||
|
Loading…
Reference in New Issue
Block a user