Mobile: remove aux1 holding hack
This commit is contained in:
parent
d974b14e2c
commit
46bd318b38
@ -1021,13 +1021,17 @@ void GenericCAO::step(float dtime, ClientEnvironment *env)
|
|||||||
bool allow_update = false;
|
bool allow_update = false;
|
||||||
|
|
||||||
// increase speed if using fast or flying fast
|
// increase speed if using fast or flying fast
|
||||||
if((g_settings->getBool("fast_move") &&
|
if (g_settings->getBool("fast_move") &&
|
||||||
m_client->checkLocalPrivilege("fast")) &&
|
m_client->checkLocalPrivilege("fast")) {
|
||||||
(controls.aux1 ||
|
#ifndef HAVE_TOUCHSCREENGUI
|
||||||
|
// do not require pressing AUX1 for Fast if HAVE_TOUCHSCREENGUI.
|
||||||
|
if ((controls.aux1 ||
|
||||||
(!player->touching_ground &&
|
(!player->touching_ground &&
|
||||||
g_settings->getBool("free_move") &&
|
g_settings->getBool("free_move") &&
|
||||||
m_client->checkLocalPrivilege("fly"))))
|
m_client->checkLocalPrivilege("fly"))))
|
||||||
|
#endif
|
||||||
new_speed *= 1.5;
|
new_speed *= 1.5;
|
||||||
|
}
|
||||||
// slowdown speed if sneeking
|
// slowdown speed if sneeking
|
||||||
if (controls.sneak && walking)
|
if (controls.sneak && walking)
|
||||||
new_speed /= 2;
|
new_speed /= 2;
|
||||||
|
@ -928,9 +928,7 @@ private:
|
|||||||
bool m_does_lost_focus_pause_game = false;
|
bool m_does_lost_focus_pause_game = false;
|
||||||
|
|
||||||
int m_reset_HW_buffer_counter = 0;
|
int m_reset_HW_buffer_counter = 0;
|
||||||
#ifdef HAVE_TOUCHSCREENGUI
|
|
||||||
bool m_cache_hold_aux1;
|
|
||||||
#endif
|
|
||||||
#if defined(__ANDROID__) || defined(__IOS__)
|
#if defined(__ANDROID__) || defined(__IOS__)
|
||||||
bool m_android_chat_open;
|
bool m_android_chat_open;
|
||||||
#endif
|
#endif
|
||||||
@ -968,11 +966,6 @@ Game::Game() :
|
|||||||
&settingChangedCallback, this);
|
&settingChangedCallback, this);
|
||||||
|
|
||||||
readSettings();
|
readSettings();
|
||||||
|
|
||||||
#ifdef HAVE_TOUCHSCREENGUI
|
|
||||||
m_cache_hold_aux1 = false; // This is initialised properly later
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1093,11 +1086,6 @@ void Game::run()
|
|||||||
|
|
||||||
set_light_table(g_settings->getFloat("display_gamma"));
|
set_light_table(g_settings->getFloat("display_gamma"));
|
||||||
|
|
||||||
#ifdef HAVE_TOUCHSCREENGUI
|
|
||||||
m_cache_hold_aux1 = g_settings->getBool("fast_move")
|
|
||||||
&& client->checkPrivilege("fast");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
irr::core::dimension2d<u32> previous_screen_size(g_settings->getU16("screen_w"),
|
irr::core::dimension2d<u32> previous_screen_size(g_settings->getU16("screen_w"),
|
||||||
g_settings->getU16("screen_h"));
|
g_settings->getU16("screen_h"));
|
||||||
|
|
||||||
@ -2215,10 +2203,6 @@ void Game::toggleFast()
|
|||||||
} else {
|
} else {
|
||||||
m_game_ui->showTranslatedStatusText("Fast mode disabled");
|
m_game_ui->showTranslatedStatusText("Fast mode disabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_TOUCHSCREENGUI
|
|
||||||
m_cache_hold_aux1 = fast_move && has_fast_privs;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2531,18 +2515,6 @@ void Game::updatePlayerControl(const CameraOrientation &cam)
|
|||||||
( (u32)(isKeyDown(KeyType::ZOOM) & 0x1) << 9)
|
( (u32)(isKeyDown(KeyType::ZOOM) & 0x1) << 9)
|
||||||
);
|
);
|
||||||
|
|
||||||
#ifdef HAVE_TOUCHSCREENGUI
|
|
||||||
/* For touch, simulate holding down AUX1 (fast move) if the user has
|
|
||||||
* the fast_move setting toggled on. If there is an aux1 key defined for
|
|
||||||
* touch then its meaning is inverted (i.e. holding aux1 means walk and
|
|
||||||
* not fast)
|
|
||||||
*/
|
|
||||||
if (m_cache_hold_aux1 && !porting::hasRealKeyboard()) {
|
|
||||||
control.aux1 = control.aux1 ^ true;
|
|
||||||
keypress_bits ^= ((u32)(1U << 5));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
LocalPlayer *player = client->getEnv().getLocalPlayer();
|
LocalPlayer *player = client->getEnv().getLocalPlayer();
|
||||||
|
|
||||||
// autojump if set: simulate "jump" key
|
// autojump if set: simulate "jump" key
|
||||||
|
@ -502,7 +502,11 @@ void LocalPlayer::applyControl(float dtime, Environment *env)
|
|||||||
bool fast_move = fast_allowed && player_settings.fast_move;
|
bool fast_move = fast_allowed && player_settings.fast_move;
|
||||||
bool pitch_move = (free_move || in_liquid) && player_settings.pitch_move;
|
bool pitch_move = (free_move || in_liquid) && player_settings.pitch_move;
|
||||||
// When aux1_descends is enabled the fast key is used to go down, so fast isn't possible
|
// When aux1_descends is enabled the fast key is used to go down, so fast isn't possible
|
||||||
|
#ifndef HAVE_TOUCHSCREENGUI
|
||||||
bool fast_climb = fast_move && control.aux1 && !player_settings.aux1_descends;
|
bool fast_climb = fast_move && control.aux1 && !player_settings.aux1_descends;
|
||||||
|
#else
|
||||||
|
bool fast_climb = fast_move && !player_settings.aux1_descends;
|
||||||
|
#endif
|
||||||
bool always_fly_fast = player_settings.always_fly_fast;
|
bool always_fly_fast = player_settings.always_fly_fast;
|
||||||
|
|
||||||
// Whether superspeed mode is used or not
|
// Whether superspeed mode is used or not
|
||||||
@ -541,7 +545,10 @@ void LocalPlayer::applyControl(float dtime, Environment *env)
|
|||||||
// New minecraft-like descend control
|
// New minecraft-like descend control
|
||||||
|
|
||||||
// Auxiliary button 1 (E)
|
// Auxiliary button 1 (E)
|
||||||
if (control.aux1) {
|
#ifndef HAVE_TOUCHSCREENGUI
|
||||||
|
if (control.aux1)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
if (!is_climbing) {
|
if (!is_climbing) {
|
||||||
// aux1 is "Turbo button"
|
// aux1 is "Turbo button"
|
||||||
if (fast_move)
|
if (fast_move)
|
||||||
@ -604,7 +611,11 @@ void LocalPlayer::applyControl(float dtime, Environment *env)
|
|||||||
else
|
else
|
||||||
speedV.Y = movement_speed_walk;
|
speedV.Y = movement_speed_walk;
|
||||||
} else {
|
} else {
|
||||||
|
#ifndef HAVE_TOUCHSCREENGUI
|
||||||
if (fast_move && control.aux1)
|
if (fast_move && control.aux1)
|
||||||
|
#else
|
||||||
|
if (fast_move)
|
||||||
|
#endif
|
||||||
speedV.Y = movement_speed_fast;
|
speedV.Y = movement_speed_fast;
|
||||||
else
|
else
|
||||||
speedV.Y = movement_speed_walk;
|
speedV.Y = movement_speed_walk;
|
||||||
@ -661,7 +672,11 @@ void LocalPlayer::applyControl(float dtime, Environment *env)
|
|||||||
if ((!touching_ground && !free_move && !is_climbing && !in_liquid) ||
|
if ((!touching_ground && !free_move && !is_climbing && !in_liquid) ||
|
||||||
(!free_move && m_can_jump && control.jump)) {
|
(!free_move && m_can_jump && control.jump)) {
|
||||||
// Jumping and falling
|
// Jumping and falling
|
||||||
|
#ifndef HAVE_TOUCHSCREENGUI
|
||||||
if (superspeed || (fast_move && control.aux1))
|
if (superspeed || (fast_move && control.aux1))
|
||||||
|
#else
|
||||||
|
if (superspeed || fast_move)
|
||||||
|
#endif
|
||||||
incH = movement_acceleration_fast * BS * dtime;
|
incH = movement_acceleration_fast * BS * dtime;
|
||||||
else
|
else
|
||||||
incH = movement_acceleration_air * BS * dtime;
|
incH = movement_acceleration_air * BS * dtime;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user