aboutsummaryrefslogtreecommitdiff
path: root/src/client/game.cpp
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2020-08-14 19:12:14 +0200
committerElias Fleckenstein <eliasfleckenstein@web.de>2020-08-14 19:12:14 +0200
commit9019e18b94940c1e8a2f5f6185692ddf672b61fe (patch)
treea39c909a2e779dd7687a88e5e2f4311cbc9b0bb0 /src/client/game.cpp
parent107dec6c0f1be1de9c1049ba4004e5c08d2e34e3 (diff)
downloaddragonfireclient-9019e18b94940c1e8a2f5f6185692ddf672b61fe.tar.xz
Some Updates
Diffstat (limited to 'src/client/game.cpp')
-rw-r--r--src/client/game.cpp42
1 files changed, 8 insertions, 34 deletions
diff --git a/src/client/game.cpp b/src/client/game.cpp
index 6a3902e1a..b08dac878 100644
--- a/src/client/game.cpp
+++ b/src/client/game.cpp
@@ -112,6 +112,8 @@ Game::Game() :
&freecamChangedCallback, this);
g_settings->registerChangedCallback("xray",
&updateAllMapBlocksCallback, this);
+ g_settings->registerChangedCallback("xray_node",
+ &updateAllMapBlocksCallback, this);
g_settings->registerChangedCallback("fullbright",
&updateAllMapBlocksCallback, this);
@@ -174,6 +176,12 @@ Game::~Game()
&settingChangedCallback, this);
g_settings->deregisterChangedCallback("freecam",
&freecamChangedCallback, this);
+ g_settings->deregisterChangedCallback("xray",
+ &updateAllMapBlocksCallback, this);
+ g_settings->deregisterChangedCallback("xray_node",
+ &updateAllMapBlocksCallback, this);
+ g_settings->deregisterChangedCallback("fullbright",
+ &updateAllMapBlocksCallback, this);
}
bool Game::startup(bool *kill,
@@ -1107,10 +1115,6 @@ 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::FREECAM)) {
@@ -1414,32 +1418,6 @@ 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");
@@ -3478,8 +3456,6 @@ void Game::showPauseMenu()
"- Mouse right: place/use\n"
"- Mouse wheel: select item\n"
"- %s: chat\n"
- "- %s: X-Ray\n"
- "- %s: Fullbright\n"
"- %s: Killaura\n"
"- %s: Freecam\n"
);
@@ -3497,8 +3473,6 @@ void Game::showPauseMenu()
GET_KEY_NAME(keymap_inventory),
GET_KEY_NAME(keymap_special_inventory),
GET_KEY_NAME(keymap_chat),
- GET_KEY_NAME(keymap_toggle_xray),
- GET_KEY_NAME(keymap_toggle_fullbright),
GET_KEY_NAME(keymap_toggle_killaura),
GET_KEY_NAME(keymap_toggle_freecam)
);