Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

Commit

Permalink
fix(Minimap): sometimes being distorted or not displaying correctly a…
Browse files Browse the repository at this point in the history
…t 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.
  • Loading branch information
vipexv committed Sep 19, 2024
1 parent 2eb1c79 commit d653892
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions modules/utils/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")

Expand All @@ -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
Expand Down

0 comments on commit d653892

Please sign in to comment.