From 23844d8836eb1e065fc76df128011deb04796c3c Mon Sep 17 00:00:00 2001 From: Maksym H Date: Thu, 12 Jan 2023 10:58:43 +0200 Subject: [PATCH] Mobile: minor legacy minimap tune --- src/client/minimap.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/client/minimap.cpp b/src/client/minimap.cpp index c06b3a9cf..4c7db524e 100644 --- a/src/client/minimap.cpp +++ b/src/client/minimap.cpp @@ -338,7 +338,6 @@ void Minimap::addMode(MinimapModeDef mode) case MINIMAP_TYPE_OFF: mode.label = gettext("Minimap hidden"); break; -#if !defined(__ANDROID__) && !defined(__IOS__) case MINIMAP_TYPE_SURFACE: mode.label = gettext("Minimap in surface mode, Zoom x%d"); if (mode.map_size > 0) @@ -349,14 +348,6 @@ void Minimap::addMode(MinimapModeDef mode) if (mode.map_size > 0) zoom = 512 / mode.map_size; break; -#else - case MINIMAP_TYPE_SURFACE: - mode.label = gettext("Minimap shown"); - break; - case MINIMAP_TYPE_RADAR: - mode.label = gettext("Minimap in radar mode"); - break; -#endif case MINIMAP_TYPE_TEXTURE: mode.label = gettext("Minimap in texture mode"); break; @@ -371,6 +362,9 @@ void Minimap::addMode(MinimapModeDef mode) porting::mt_snprintf(label_buf, sizeof(label_buf), mode.label.c_str(), zoom); mode.label = label_buf; +#if !defined(__ANDROID__) && !defined(__IOS__) + mode.label = mode.label.substr(0, mode.label.find(", ")); +#endif } m_modes.push_back(mode); @@ -598,10 +592,11 @@ void Minimap::drawMinimap() // Non hud managed minimap drawing (legacy minimap) v2u32 screensize = RenderingEngine::get_instance()->getWindowSize(); const u32 size = 0.25 * screensize.Y; + const u32 padding = 10 * RenderingEngine::getDisplayDensity(); drawMinimap(core::rect( - screensize.X - size - 10, 10, - screensize.X - 10, size + 10)); + screensize.X - size - padding, padding, + screensize.X - padding, size + padding)); } void Minimap::drawMinimap(core::rect rect) {