Minimap Additional Info
Streams supplementary info (distance to target, location name, police status) alongside the minimap.
Streams supplementary info (distance to target, location name, police status) alongside the minimap.
Overview
ui_apps_minimap_additionalInfo runs per-frame checks for route distance, current location name, and police pursuit status, then queues changes to the "minimap" UI stream.
Extension path: lua/ge/extensions/ui/apps/minimap/additionalInfo.lua
Exports (M)
| Function | Signature | Description |
|---|---|---|
requestAdditionalInfo | () | Forces a re-send of all additional info on next frame. |
onUpdate | (dt) | Per-frame hook: checks route, location, police state and streams changes. |
onReachedTargetPos | () | Clears distance-to-target when destination is reached. |
onClientEndMission | () | Clears all additional info on mission end. |
onSetBigmapNavFocus | (pos) | Resets distance when navigation focus is cleared. |
Internals
Streamed Fields
The additionalInfo table is queued to the "minimap" stream with these optional fields:
| Field | Type | Source |
|---|---|---|
distToTarget | string | core_groundMarkers.routePlanner.path[1].distToTarget via translateDistance() |
locationName | string | gameplay_city.getHighestPrioZone() or level title fallback |
policeMode | string | "disabled", "visibleToPolice", or "hiddenFromPolice" from gameplay_police |
Change Detection
Each check compares against the previous value and only sets hasNewAdditionalInfo = true when something changes:
local function checkRoute()
local rp = core_groundMarkers.routePlanner
if not rp or not rp.path or not rp.path[1] then
if oldDistToTarget then resetDistToTarget() end
return
end
local distToTarget, unit = translateDistance(rp.path[1].distToTarget, "auto")
if distToTarget ~= oldDistToTarget then
oldDistToTarget = distToTarget
additionalInfo.distToTarget = string.format("%.1f %s", distToTarget, unit)
hasNewAdditionalInfo = true
end
endLocation Name Resolution
Falls back from gameplay_city zone names to level title:
local location = gameplay_city.getHighestPrioZone(camPos)
if location then
locationName = location.name
else
-- Fallback to level title from core_levels
endHow It Works
onUpdateruns every frame, callingcheckRoute(),checkLocationName(),checkPolice()- Each check compares current state against cached previous value
- If any field changed,
hasNewAdditionalInfoflag is set - At end of frame, changed info is queued via
guihooks.queueStream("minimap", additionalInfo) - UI minimap widget reads the stream and displays distance, location, and police indicators
Additional Exports
The following exports are available but not yet documented in detail:
M.onClientEndMissionM.onReachedTargetPosM.onSetBigmapNavFocusM.onUpdateM.requestAdditionalInfo