Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change some keys to be triggered once every key press #13883

Merged
merged 1 commit into from
Oct 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/client/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2076,29 +2076,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();
Expand Down Expand Up @@ -3134,7 +3134,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
Expand Down