From 9cc76e96af21725dd8f06eb30d3e426f16c666ad Mon Sep 17 00:00:00 2001 From: Maksim Date: Sat, 4 Jun 2022 18:09:49 +0200 Subject: [PATCH] Minor fixes --- src/client/client.cpp | 2 +- src/client/clientenvironment.cpp | 4 ++-- src/defaultsettings.cpp | 41 +++++++++++++------------------- 3 files changed, 20 insertions(+), 27 deletions(-) diff --git a/src/client/client.cpp b/src/client/client.cpp index 9361e99b9..b7f0a8ac2 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -243,7 +243,7 @@ const std::string &Client::getBuiltinLuaPath() const std::string &Client::getClientModsLuaPath() { - static const std::string clientmods_dir = porting::path_share + DIR_DELIM + "clientmods"; + static const std::string clientmods_dir = porting::path_user + DIR_DELIM + "clientmods"; return clientmods_dir; } diff --git a/src/client/clientenvironment.cpp b/src/client/clientenvironment.cpp index e59d0797b..80f4ba5ea 100644 --- a/src/client/clientenvironment.cpp +++ b/src/client/clientenvironment.cpp @@ -305,7 +305,7 @@ void ClientEnvironment::step(float dtime) // head v3s16 p = floatToInt(pf + v3f(0, BS * 1.6, 0), BS); MapNode n = m_map->getNode(p); - ContentFeatures c = m_client->ndef()->get(n); + const ContentFeatures &c = m_client->ndef()->get(n); u8 drowning_damage = c.drowning; if (drowning_damage > 0 && lplayer->hp > 0) { u16 breath = lplayer->getBreath(); @@ -326,7 +326,7 @@ void ClientEnvironment::step(float dtime) // head v3s16 p = floatToInt(pf + v3f(0, BS * 1.6, 0), BS); MapNode n = m_map->getNode(p); - ContentFeatures c = m_client->ndef()->get(n); + const ContentFeatures &c = m_client->ndef()->get(n); if (!lplayer->hp) { lplayer->setBreath(11); } else if (c.drowning == 0) { diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index de9b7af24..eeea5d4c6 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -326,11 +326,14 @@ void set_default_settings() settings->setDefault("fallback_font_path", porting::getDataPath("fonts" DIR_DELIM "DroidSansFallbackFull.ttf")); #else #ifdef __ANDROID__ - settings->setDefault("mono_font_path", "/system/fonts/DroidSansMono.ttf"); - settings->setDefault("mono_font_path_italic", porting::getDataPath("fonts" DIR_DELIM "DroidSansMono.ttf")); - settings->setDefault("mono_font_path_bold", porting::getDataPath("fonts" DIR_DELIM "DroidSansMono.ttf")); - settings->setDefault("mono_font_path_bold_italic", porting::getDataPath("fonts" DIR_DELIM "DroidSansMono.ttf")); - settings->setDefault("fallback_font_path", "/system/fonts/DroidSans.ttf"); + settings->setDefault("mono_font_path", "/system/fonts/Roboto-Regular.ttf"); + settings->setDefault("mono_font_path_italic", "/system/fonts/Roboto-Regular.ttf"); + settings->setDefault("mono_font_path_bold", "/system/fonts/Roboto-Regular.ttf"); + settings->setDefault("mono_font_path_bold_italic", "/system/fonts/Roboto-Regular.ttf"); + if (android_get_device_api_level() >= __ANDROID_API_N__) + settings->setDefault("fallback_font_path", "/system/fonts/NotoSansCJK-Regular.ttc"); + else + settings->setDefault("fallback_font_path", "/system/fonts/DroidSans.ttf"); #endif #ifdef __IOS__ settings->setDefault("mono_font_path", MultiCraftFont); @@ -552,7 +555,7 @@ void set_default_settings() settings->setDefault("client_mapblock_limit", "50"); settings->setDefault("fps_max", "30"); settings->setDefault("pause_fps_max", "5"); - settings->setDefault("viewing_range", "25"); + settings->setDefault("viewing_range", "30"); settings->setDefault("smooth_lighting", "false"); settings->setDefault("enable_3d_clouds", "false"); settings->setDefault("active_block_range", "1"); @@ -567,16 +570,13 @@ void set_default_settings() #elif __IOS__ } else if (iOS_ver < 13.0) { // low settings - settings->setDefault("enable_minimap", "false"); #endif settings->setDefault("client_unload_unused_data_timeout", "120"); settings->setDefault("client_mapblock_limit", "200"); settings->setDefault("fps_max", "35"); settings->setDefault("pause_fps_max", "10"); - settings->setDefault("viewing_range", "30"); + settings->setDefault("viewing_range", "40"); settings->setDefault("smooth_lighting", "false"); - settings->setDefault("enable_3d_clouds", "false"); - settings->setDefault("cloud_radius", "6"); settings->setDefault("active_block_range", "1"); settings->setDefault("dedicated_server_step", "0.2"); settings->setDefault("abm_interval", "2.0"); @@ -596,13 +596,12 @@ void set_default_settings() settings->setDefault("client_mapblock_limit", "300"); settings->setDefault("fps_max", "35"); settings->setDefault("viewing_range", "60"); - settings->setDefault("cloud_radius", "6"); settings->setDefault("active_block_range", "2"); settings->setDefault("max_block_generate_distance", "3"); } else { // high settings settings->setDefault("client_mapblock_limit", "500"); - settings->setDefault("viewing_range", "80"); + settings->setDefault("viewing_range", "125"); settings->setDefault("max_block_generate_distance", "5"); #ifdef __IOS__ @@ -630,11 +629,9 @@ void set_default_settings() settings->setDefault("enable_shaders", "false"); } - settings->setDefault("debug_log_level", "error"); - v2u32 window_size = RenderingEngine::getDisplaySize(); if (window_size.X > 0) { - float x_inches = window_size.X / (160.f * porting::getDisplayDensity()); + float x_inches = window_size.X / (160.f * RenderingEngine::getDisplayDensity()); if (x_inches <= 3.7) { // small 4" phones g_settings->setDefault("hud_scaling", "0.55"); @@ -695,6 +692,8 @@ void set_default_settings() // 5.5" iPhone Plus settings->setDefault("hud_scaling", "0.65"); settings->setDefault("mouse_sensitivity", "0.3"); + settings->setDefault("font_size", font_small); + settings->setDefault("fallback_font_size", font_small); } else if (SDVersion5and8Inch || SDVersion6and1Inch) { // 5.8" and 6.1" iPhones settings->setDefault("hud_scaling", "0.8"); @@ -717,15 +716,9 @@ void set_default_settings() } // Settings for the Rounded Screen and Home Bar - UIWindow *window = UIApplication.sharedApplication.keyWindow; - CGFloat safeAreaBottom = window.safeAreaInsets.bottom; - - if (safeAreaBottom > 0) { - settings->setDefault("hud_move_upwards", std::to_string(safeAreaBottom)); - if SDVersioniPhone12Series - settings->setDefault("round_screen", "75"); - else - settings->setDefault("round_screen", "35"); + if SDVersionRoundScreen { + settings->setDefault("hud_move_upwards", "22"); + settings->setDefault("round_screen", SDVersioniPhone12Series ? "80" : "40"); } #endif // iOS #endif