#ifdef HAVE_TOUCHSCREENGUI
bool m_cache_hold_aux1;
+ bool m_touch_use_crosshair;
+ inline bool isNoCrosshairAllowed() {
+ return !m_touch_use_crosshair && camera->getCameraMode() == CAMERA_MODE_FIRST;
+ }
#endif
#ifdef __ANDROID__
bool m_android_chat_open;
m_invert_mouse = g_settings->getBool("invert_mouse");
m_first_loop_after_window_activation = true;
+#ifdef HAVE_TOUCHSCREENGUI
+ m_touch_use_crosshair = g_settings->getBool("touch_use_crosshair");
+#endif
+
g_client_translations->clear();
// address can change if simple_singleplayer_mode
camera->toggleCameraMode();
+#ifdef HAVE_TOUCHSCREENGUI
+ if (g_touchscreengui)
+ g_touchscreengui->setUseCrosshair(!isNoCrosshairAllowed());
+#endif
+
// Make the player visible depending on camera mode.
playercao->updateMeshCulling();
playercao->setChildrenVisible(camera->getCameraMode() > CAMERA_MODE_FIRST);
shootline.end = shootline.start + camera_direction * BS * d;
#ifdef HAVE_TOUCHSCREENGUI
-
- if ((g_settings->getBool("touchtarget")) && (g_touchscreengui)) {
+ if (g_touchscreengui && isNoCrosshairAllowed()) {
shootline = g_touchscreengui->getShootline();
// Scale shootline to the acual distance the player can reach
- shootline.end = shootline.start
- + shootline.getVector().normalize() * BS * d;
+ shootline.end = shootline.start +
+ shootline.getVector().normalize() * BS * d;
shootline.start += intToFloat(camera_offset, BS);
shootline.end += intToFloat(camera_offset, BS);
}
-
#endif
PointedThing pointed = updatePointedThing(shootline,
(player->hud_flags & HUD_FLAG_CROSSHAIR_VISIBLE) &&
(camera->getCameraMode() != CAMERA_MODE_THIRD_FRONT));
#ifdef HAVE_TOUCHSCREENGUI
- try {
- draw_crosshair = !g_settings->getBool("touchtarget");
- } catch (SettingNotFoundException) {
- }
+ if (isNoCrosshairAllowed())
+ draw_crosshair = false;
#endif
m_rendering_engine->draw_scene(skycolor, m_game_ui->m_flags.show_hud,
m_game_ui->m_flags.show_minimap, draw_wield_tool, draw_crosshair);