From d65389283dfd7210467dc08e6a72fd9db32257a2 Mon Sep 17 00:00:00 2001 From: vipex <101529155+vipexv@users.noreply.github.com> Date: Thu, 19 Sep 2024 18:07:44 +0200 Subject: [PATCH] fix(Minimap): sometimes being distorted or not displaying correctly at all There have been multiple cases and bugs with the minimap, this was mainly due to us not refreshing the minimap, now were running a 10 second thread after the minimal is loaded to prevent that from happening. --- modules/utils/shared.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/utils/shared.lua b/modules/utils/shared.lua index 6cf5d1a..3879979 100644 --- a/modules/utils/shared.lua +++ b/modules/utils/shared.lua @@ -98,6 +98,21 @@ utility.isFrameworkValid = function() return validFrameworks[framework] ~= nil end +-- Prevents the bigmap from staying active after the minimap is closed, since sometimes the bigmap is still active and stuck on the screen +utility.preventBigmapFromStayingActive = function() + local timeout = 0 + while true do + utility.debug("(utility:preventBigmapFromStayingActive) Running, timeout: ", timeout) + SetBigmapActive(false, false) + if timeout >= 10000 then + break + else + timeout = timeout + 1000 + end + Wait(1000) + end +end + utility.setupMinimap = function() utility.debug("(utility:setupMinimap) Setting up minimap.") local defaultAspectRatio = 1920 / 1080 @@ -115,6 +130,7 @@ utility.setupMinimap = function() Wait(100) end + SetMinimapClipType(0) AddReplaceTexture("platform:/textures/graphics", "radarmasksm", "squaremap", "radarmasksm") AddReplaceTexture("platform:/textures/graphics", "radarmask1g", "squaremap", "radarmasksm") @@ -123,7 +139,9 @@ utility.setupMinimap = function() SetMinimapComponentPosition("minimap_blur", "L", "B", -0.01 + minimapOffset, 0.025, 0.262, 0.300) SetBlipAlpha(GetNorthRadarBlip(), 0) + SetBigmapActive(true, false) SetMinimapClipType(0) + CreateThread(utility.preventBigmapFromStayingActive) end ---@param coords vector3