diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-07-06 15:50:55 +0200 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-07-06 15:50:55 +0200 |
commit | e610149c0cc3516b61115541f2f4f78344a0bb2c (patch) | |
tree | b1205a15af51db02c9301f4ab8ecdd7527d13c10 /src/client/game.cpp | |
parent | a87805a9445f280ca71da322c4b32cf357744511 (diff) | |
download | dragonfireclient-e610149c0cc3516b61115541f2f4f78344a0bb2c.tar.xz |
Initial Commit
Diffstat (limited to 'src/client/game.cpp')
-rw-r--r-- | src/client/game.cpp | 50 |
1 files changed, 47 insertions, 3 deletions
diff --git a/src/client/game.cpp b/src/client/game.cpp index 9f8eb8c94..7c2249296 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -1069,6 +1069,12 @@ void Game::processKeyInput() toggleFast(); } else if (wasKeyDown(KeyType::NOCLIP)) { toggleNoClip(); + } else if (wasKeyDown(KeyType::XRAY)) { + toggleXray(); + } else if (wasKeyDown(KeyType::FULLBRIGHT)) { + toggleFullbright(); + } else if (wasKeyDown(KeyType::KILLAURA)) { + toggleKillaura(); } else if (wasKeyDown(KeyType::MUTE)) { bool new_mute_sound = !g_settings->getBool("mute_sound"); g_settings->setBool("mute_sound", new_mute_sound); @@ -1327,6 +1333,44 @@ void Game::toggleNoClip() } } +void Game::toggleXray() +{ + bool xray = ! g_settings->getBool("xray"); + g_settings->set("xray", bool_to_cstr(xray)); + + if (xray) { + m_game_ui->showTranslatedStatusText("Xray enabled"); + } else { + m_game_ui->showTranslatedStatusText("Xray disabled"); + } + client->m_mesh_update_thread.doUpdate(); +} + +void Game::toggleFullbright() +{ + bool fullbright = ! g_settings->getBool("fullbright"); + g_settings->set("fullbright", bool_to_cstr(fullbright)); + + if (fullbright) { + m_game_ui->showTranslatedStatusText("Fullbright enabled"); + } else { + m_game_ui->showTranslatedStatusText("Fullbright disabled"); + } + client->m_mesh_update_thread.doUpdate(); +} + +void Game::toggleKillaura() +{ + bool killaura = ! g_settings->getBool("killaura"); + g_settings->set("killaura", bool_to_cstr(killaura)); + + if (killaura) { + m_game_ui->showTranslatedStatusText("Killaura enabled"); + } else { + m_game_ui->showTranslatedStatusText("Killaura disabled"); + } +} + void Game::toggleCinematic() { bool cinematic = !g_settings->getBool("cinematic"); @@ -2181,7 +2225,7 @@ void Game::processPlayerInteraction(f32 dtime, bool show_hud, bool show_debug) f32 d = getToolRange(selected_def, hand_item.getDefinition(itemdef_manager)); if(g_settings->getBool("increase_tool_range")) - d = 1000; + d = 5; core::line3d<f32> shootline; @@ -2697,7 +2741,7 @@ void Game::handlePointingAtObject(const PointedThing &pointed, m_game_ui->setInfoText(infotext); - if (input->getLeftState() || g_settings->getBool("killaura")) { + if (input->getLeftState() || (g_settings->getBool("killaura") && ! g_settings->getBool("killaura_fast"))) { bool do_punch = false; bool do_punch_damage = false; @@ -2707,7 +2751,7 @@ void Game::handlePointingAtObject(const PointedThing &pointed, runData.object_hit_delay_timer = object_hit_delay; } - if (input->getLeftClicked() || g_settings->getBool("killaura")) + if (input->getLeftClicked() || (g_settings->getBool("killaura") && ! g_settings->getBool("killaura_fast"))) do_punch = true; if (do_punch) { |