aboutsummaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2012-02-01 02:24:55 +0100
committerKahrl <kahrl@gmx.net>2012-02-01 02:24:55 +0100
commit2cb96d9d6800a3fd74bb6264974e8811ff8d4acd (patch)
tree3fa798dda5e6b9ccaa838864de6e62742899ebe0 /src/game.cpp
parent78bf92175a81e96545c9bf2f331c344012c71230 (diff)
downloadminetest-2cb96d9d6800a3fd74bb6264974e8811ff8d4acd.tar.gz
minetest-2cb96d9d6800a3fd74bb6264974e8811ff8d4acd.tar.bz2
minetest-2cb96d9d6800a3fd74bb6264974e8811ff8d4acd.zip
Page up and down change the minimum viewing range
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 76fdedcf0..f35b85cb6 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -1507,6 +1507,36 @@ void the_game(
statustext_time = 0;
}
}
+ else if(input->wasKeyDown(getKeySetting("keymap_increase_viewing_range_min")))
+ {
+ s16 range = g_settings->getS16("viewing_range_nodes_min");
+ s16 range_new = range + 10;
+ g_settings->set("viewing_range_nodes_min", itos(range_new));
+ statustext = narrow_to_wide(
+ "Minimum viewing range changed from "
+ + itos(range) + " to " + itos(range_new));
+ statustext_time = 0;
+ }
+ else if(input->wasKeyDown(getKeySetting("keymap_decrease_viewing_range_min")))
+ {
+ s16 range = g_settings->getS16("viewing_range_nodes_min");
+ s16 range_new = range - 10;
+ if(range_new >= 0)
+ {
+ g_settings->set("viewing_range_nodes_min",
+ itos(range_new));
+ statustext = narrow_to_wide(
+ "Minimum viewing range changed from "
+ + itos(range) + " to "
+ + itos(range_new));
+ statustext_time = 0;
+ }
+ else
+ {
+ statustext = L"Minimum viewing range already at minimum";
+ statustext_time = 0;
+ }
+ }
// Item selection with mouse wheel
u16 new_playeritem = client.getPlayerItem();