From 6e15ba440ca656e17212aecaacbddfdbc039db45 Mon Sep 17 00:00:00 2001 From: RyujinZX Date: Tue, 14 Jun 2022 19:30:53 +0300 Subject: [PATCH] Maybe fixed the problem with the interface from the card. --- .../src/user/cheat/imap/InteractiveMap.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/cheat-library/src/user/cheat/imap/InteractiveMap.cpp b/cheat-library/src/user/cheat/imap/InteractiveMap.cpp index 6356df2..42c5217 100644 --- a/cheat-library/src/user/cheat/imap/InteractiveMap.cpp +++ b/cheat-library/src/user/cheat/imap/InteractiveMap.cpp @@ -18,6 +18,7 @@ namespace cheat::feature { + app::Rect mapRect = {}; InteractiveMap::InteractiveMap() : Feature(), NFEX(f_Enabled, "Interactive map", "m_InteractiveMap", "InteractiveMap", false, false), @@ -1550,7 +1551,7 @@ namespace cheat::feature UPDATE_DELAY_VAR(ImCircle, _miniMapCircle, 2000); auto uiManager = GET_SINGLETON(MoleMole_UIManager); - if (uiManager == nullptr || uiManager->fields._sceneCanvas == nullptr) + if (uiManager == nullptr || uiManager->fields._sceneCanvas == nullptr || uiManager->fields._uiCamera == nullptr) return {}; auto back = _monoMiniMap->fields._grpMapBack; @@ -1560,13 +1561,16 @@ namespace cheat::feature auto mapPos = app::Transform_get_position(reinterpret_cast(back), nullptr); auto center = app::Camera_WorldToScreenPoint(uiManager->fields._uiCamera, mapPos, nullptr); center.y = app::Screen_get_height(nullptr) - center.y; + + if (mapRect.m_Width == 0) + mapRect = app::RectTransform_get_rect(back, nullptr); - auto mapRect = app::RectTransform_get_rect(back, nullptr); float scaleFactor = app::Canvas_get_scaleFactor(uiManager->fields._sceneCanvas, nullptr); - _miniMapCircle = { - ImVec2(center.x, center.y), - (mapRect.m_Width * scaleFactor) / 2 - }; + if (scaleFactor != 0) + _miniMapCircle = { + ImVec2(center.x, center.y), + (mapRect.m_Width * scaleFactor) / 2 + }; return _miniMapCircle; }