mirror of
https://github.com/minetest/minetest.git
synced 2024-11-24 00:23:46 +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
|
#endif
|
||||||
} else if (wasKeyDown(KeyType::CINEMATIC)) {
|
} else if (wasKeyDown(KeyType::CINEMATIC)) {
|
||||||
toggleCinematic();
|
toggleCinematic();
|
||||||
} else if (wasKeyDown(KeyType::SCREENSHOT)) {
|
} else if (wasKeyPressed(KeyType::SCREENSHOT)) {
|
||||||
client->makeScreenshot();
|
client->makeScreenshot();
|
||||||
} else if (wasKeyDown(KeyType::TOGGLE_BLOCK_BOUNDS)) {
|
} else if (wasKeyPressed(KeyType::TOGGLE_BLOCK_BOUNDS)) {
|
||||||
toggleBlockBounds();
|
toggleBlockBounds();
|
||||||
} else if (wasKeyDown(KeyType::TOGGLE_HUD)) {
|
} else if (wasKeyPressed(KeyType::TOGGLE_HUD)) {
|
||||||
m_game_ui->toggleHud();
|
m_game_ui->toggleHud();
|
||||||
} else if (wasKeyDown(KeyType::MINIMAP)) {
|
} else if (wasKeyPressed(KeyType::MINIMAP)) {
|
||||||
toggleMinimap(isKeyDown(KeyType::SNEAK));
|
toggleMinimap(isKeyDown(KeyType::SNEAK));
|
||||||
} else if (wasKeyDown(KeyType::TOGGLE_CHAT)) {
|
} else if (wasKeyPressed(KeyType::TOGGLE_CHAT)) {
|
||||||
m_game_ui->toggleChat(client);
|
m_game_ui->toggleChat(client);
|
||||||
} else if (wasKeyDown(KeyType::TOGGLE_FOG)) {
|
} else if (wasKeyPressed(KeyType::TOGGLE_FOG)) {
|
||||||
toggleFog();
|
toggleFog();
|
||||||
} else if (wasKeyDown(KeyType::TOGGLE_UPDATE_CAMERA)) {
|
} else if (wasKeyDown(KeyType::TOGGLE_UPDATE_CAMERA)) {
|
||||||
toggleUpdateCamera();
|
toggleUpdateCamera();
|
||||||
} else if (wasKeyDown(KeyType::TOGGLE_DEBUG)) {
|
} else if (wasKeyPressed(KeyType::TOGGLE_DEBUG)) {
|
||||||
toggleDebug();
|
toggleDebug();
|
||||||
} else if (wasKeyDown(KeyType::TOGGLE_PROFILER)) {
|
} else if (wasKeyPressed(KeyType::TOGGLE_PROFILER)) {
|
||||||
m_game_ui->toggleProfiler();
|
m_game_ui->toggleProfiler();
|
||||||
} else if (wasKeyDown(KeyType::INCREASE_VIEWING_RANGE)) {
|
} else if (wasKeyDown(KeyType::INCREASE_VIEWING_RANGE)) {
|
||||||
increaseViewRange();
|
increaseViewRange();
|
||||||
} else if (wasKeyDown(KeyType::DECREASE_VIEWING_RANGE)) {
|
} else if (wasKeyDown(KeyType::DECREASE_VIEWING_RANGE)) {
|
||||||
decreaseViewRange();
|
decreaseViewRange();
|
||||||
} else if (wasKeyDown(KeyType::RANGESELECT)) {
|
} else if (wasKeyPressed(KeyType::RANGESELECT)) {
|
||||||
toggleFullViewRange();
|
toggleFullViewRange();
|
||||||
} else if (wasKeyDown(KeyType::ZOOM)) {
|
} else if (wasKeyDown(KeyType::ZOOM)) {
|
||||||
checkZoomEnabled();
|
checkZoomEnabled();
|
||||||
@ -3138,7 +3138,7 @@ void Game::updateCamera(f32 dtime)
|
|||||||
|
|
||||||
v3s16 old_camera_offset = camera->getOffset();
|
v3s16 old_camera_offset = camera->getOffset();
|
||||||
|
|
||||||
if (wasKeyDown(KeyType::CAMERA_MODE)) {
|
if (wasKeyPressed(KeyType::CAMERA_MODE)) {
|
||||||
GenericCAO *playercao = player->getCAO();
|
GenericCAO *playercao = player->getCAO();
|
||||||
|
|
||||||
// If playercao not loaded, don't change camera
|
// If playercao not loaded, don't change camera
|
||||||
|
Loading…
Reference in New Issue
Block a user