1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Repeated right clicking when holding the right mouse button

Configure using repeat_rightclick_time in minetest.conf
This commit is contained in:
Jeija 2013-01-04 15:19:16 +01:00 committed by PilzAdam
parent 5bc14e2fe4
commit b50da63852
3 changed files with 12 additions and 1 deletions

View file

@ -1335,6 +1335,8 @@ void the_game(
float time_of_day = 0;
float time_of_day_smooth = 0;
float repeat_rightclick_timer = 0;
/*
Shader constants
*/
@ -2266,6 +2268,9 @@ void the_game(
bool left_punch = false;
soundmaker.m_player_leftpunch_sound.name = "";
if(input->getRightState())
repeat_rightclick_timer += dtime;
if(playeritem_usable && input->getLeftState())
{
if(input->getLeftClicked())
@ -2406,8 +2411,10 @@ void the_game(
camera.setDigging(0); // left click animation
}
if(input->getRightClicked())
if(input->getRightClicked() ||
repeat_rightclick_timer >= g_settings->getFloat("repeat_rightclick_time"))
{
repeat_rightclick_timer = 0;
infostream<<"Ground right-clicked"<<std::endl;
// Sign special case, at least until formspec is properly implemented.