mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 16:13:46 +01:00
Make shift the default descent control on ladders and when flying
"aux1_descends" setting switches to the old descend control.
This commit is contained in:
parent
f60227f112
commit
43ebec2be1
@ -15,7 +15,7 @@
|
|||||||
# https://bitbucket.org/celeron55/minetest/src/tip/src/defaultsettings.cpp
|
# https://bitbucket.org/celeron55/minetest/src/tip/src/defaultsettings.cpp
|
||||||
#
|
#
|
||||||
# A vim command to convert most of defaultsettings.cpp to conf file format:
|
# A vim command to convert most of defaultsettings.cpp to conf file format:
|
||||||
# :'<,'>s/\tg_settings\.setDefault("\([^"]*\)", "\([^"]*\)");.*/#\1 = \2/g
|
# :'<,'>s/\tsettings->setDefault("\([^"]*\)", "\([^"]*\)");.*/#\1 = \2/g
|
||||||
# Note: Some of the settings are implemented in Lua
|
# Note: Some of the settings are implemented in Lua
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -49,8 +49,14 @@
|
|||||||
#keymap_freemove = KEY_KEY_K
|
#keymap_freemove = KEY_KEY_K
|
||||||
#keymap_fastmove = KEY_KEY_J
|
#keymap_fastmove = KEY_KEY_J
|
||||||
#keymap_screenshot = KEY_F12
|
#keymap_screenshot = KEY_F12
|
||||||
|
# If true, keymap_special1 instead of keymap_sneak is used for climbing down and descending
|
||||||
|
#aux1_descends = false
|
||||||
# Some (temporary) keys for debugging
|
# Some (temporary) keys for debugging
|
||||||
#keymap_print_debug_stacks = KEY_KEY_P
|
#keymap_print_debug_stacks = KEY_KEY_P
|
||||||
|
#keymap_quicktune_prev = KEY_HOME
|
||||||
|
#keymap_quicktune_next = KEY_END
|
||||||
|
#keymap_quicktune_dec = KEY_NEXT
|
||||||
|
#keymap_quicktune_inc = KEY_PRIOR
|
||||||
|
|
||||||
# Minimum FPS
|
# Minimum FPS
|
||||||
# The amount of rendered stuff is dynamically set according to this
|
# The amount of rendered stuff is dynamically set according to this
|
||||||
|
@ -52,6 +52,7 @@ void set_default_settings(Settings *settings)
|
|||||||
settings->setDefault("keymap_toggle_profiler", "KEY_F6");
|
settings->setDefault("keymap_toggle_profiler", "KEY_F6");
|
||||||
settings->setDefault("keymap_increase_viewing_range_min", "+");
|
settings->setDefault("keymap_increase_viewing_range_min", "+");
|
||||||
settings->setDefault("keymap_decrease_viewing_range_min", "-");
|
settings->setDefault("keymap_decrease_viewing_range_min", "-");
|
||||||
|
settings->setDefault("aux1_descends", "false");
|
||||||
// Some (temporary) keys for debugging
|
// Some (temporary) keys for debugging
|
||||||
settings->setDefault("keymap_print_debug_stacks", "KEY_KEY_P");
|
settings->setDefault("keymap_print_debug_stacks", "KEY_KEY_P");
|
||||||
settings->setDefault("keymap_quicktune_prev", "KEY_HOME");
|
settings->setDefault("keymap_quicktune_prev", "KEY_HOME");
|
||||||
|
@ -359,31 +359,70 @@ void LocalPlayer::applyControl(float dtime)
|
|||||||
if(free_move && fast_move)
|
if(free_move && fast_move)
|
||||||
superspeed = true;
|
superspeed = true;
|
||||||
|
|
||||||
// Auxiliary button 1 (E)
|
// Old descend control
|
||||||
if(control.aux1)
|
if(g_settings->getBool("aux1_descends"))
|
||||||
{
|
{
|
||||||
if(free_move)
|
// Auxiliary button 1 (E)
|
||||||
|
if(control.aux1)
|
||||||
{
|
{
|
||||||
// In free movement mode, aux1 descends
|
if(free_move)
|
||||||
v3f speed = getSpeed();
|
{
|
||||||
if(fast_move)
|
// In free movement mode, aux1 descends
|
||||||
speed.Y = -20*BS;
|
v3f speed = getSpeed();
|
||||||
|
if(fast_move)
|
||||||
|
speed.Y = -20*BS;
|
||||||
|
else
|
||||||
|
speed.Y = -walkspeed_max;
|
||||||
|
setSpeed(speed);
|
||||||
|
}
|
||||||
|
else if(is_climbing)
|
||||||
|
{
|
||||||
|
v3f speed = getSpeed();
|
||||||
|
speed.Y = -3*BS;
|
||||||
|
setSpeed(speed);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
speed.Y = -walkspeed_max;
|
{
|
||||||
setSpeed(speed);
|
// If not free movement but fast is allowed, aux1 is
|
||||||
|
// "Turbo button"
|
||||||
|
if(fast_move)
|
||||||
|
superspeed = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(is_climbing)
|
}
|
||||||
|
// New minecraft-like descend control
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Auxiliary button 1 (E)
|
||||||
|
if(control.aux1)
|
||||||
{
|
{
|
||||||
v3f speed = getSpeed();
|
if(!free_move && !is_climbing)
|
||||||
speed.Y = -3*BS;
|
{
|
||||||
setSpeed(speed);
|
// If not free movement but fast is allowed, aux1 is
|
||||||
|
// "Turbo button"
|
||||||
|
if(fast_move)
|
||||||
|
superspeed = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if(control.sneak)
|
||||||
{
|
{
|
||||||
// If not free movement but fast is allowed, aux1 is
|
if(free_move)
|
||||||
// "Turbo button"
|
{
|
||||||
if(fast_move)
|
// In free movement mode, sneak descends
|
||||||
superspeed = true;
|
v3f speed = getSpeed();
|
||||||
|
if(fast_move)
|
||||||
|
speed.Y = -20*BS;
|
||||||
|
else
|
||||||
|
speed.Y = -walkspeed_max;
|
||||||
|
setSpeed(speed);
|
||||||
|
}
|
||||||
|
else if(is_climbing)
|
||||||
|
{
|
||||||
|
v3f speed = getSpeed();
|
||||||
|
speed.Y = -3*BS;
|
||||||
|
setSpeed(speed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user