aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorteddydestodes <derkomtur@schattengang.net>2011-05-29 19:17:42 +0200
committerteddydestodes <derkomtur@schattengang.net>2011-05-29 19:17:42 +0200
commit544aeb08404f8bb6848f64140909715afbf7d1f1 (patch)
tree264af4896dd66c5c0ed0046dcaf0d8899e2135f3 /src
parent5200f96707fba93475303be414a32ebf25cdcdd2 (diff)
downloadminetest-544aeb08404f8bb6848f64140909715afbf7d1f1.tar.gz
minetest-544aeb08404f8bb6848f64140909715afbf7d1f1.tar.bz2
minetest-544aeb08404f8bb6848f64140909715afbf7d1f1.zip
fast_move and free_move can now be toggled
Diffstat (limited to 'src')
-rw-r--r--src/defaultsettings.cpp2
-rw-r--r--src/game.cpp22
2 files changed, 24 insertions, 0 deletions
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index f11b0b2d7..e2ace0fe2 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -40,6 +40,8 @@ void set_default_settings()
g_settings.setDefault("keymap_inventory", "KEY_KEY_I");
g_settings.setDefault("keymap_chat", "KEY_KEY_T");
g_settings.setDefault("keymap_rangeselect", "KEY_KEY_R");
+ g_settings.setDefault("keymap_freemove", "KEY_KEY_K");
+ g_settings.setDefault("keymap_fastmove", "KEY_KEY_J");
// Some (temporary) keys for debugging
g_settings.setDefault("keymap_special1", "KEY_KEY_E");
g_settings.setDefault("keymap_print_debug_stacks", "KEY_KEY_P");
diff --git a/src/game.cpp b/src/game.cpp
index 603a86da3..7970a6ed9 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -1147,6 +1147,28 @@ void the_game(
&g_menumgr, dest,
L""))->drop();
}
+ else if(input->wasKeyDown(getKeySetting("keymap_freemove")))
+ {
+ if(g_settings.getBool("free_move"))
+ {
+ g_settings.set("free_move","false");
+ }
+ else
+ {
+ g_settings.set("free_move","true");
+ }
+ }
+ else if(input->wasKeyDown(getKeySetting("keymap_fastmove")))
+ {
+ if(g_settings.getBool("fast_move"))
+ {
+ g_settings.set("fast_move","false");
+ }
+ else
+ {
+ g_settings.set("fast_move","true");
+ }
+ }
// Item selection with mouse wheel
{