GE Lua Documentation

Press F to search!

formatMissionForBigmap

Definition


-- @/lua/ge/extensions/freeroam/bigMapPoiProvider.lua:199

M.formatMissionForBigmap = function(elemData)
  local mission = gameplay_missions_missions.getMissionById(elemData.missionId)
  local qtEnabled = (not career_career.isActive()) or (career_modules_linearTutorial.getTutorialFlag('quickTravelEnabled'))
  if mission then
    local ret = {
      id = elemData.missionId,
      icon = mission.iconFontIcon,
      --clusterId = elemData.clusterId,
      idInCluster = elemData.idInCluster,
      name = mission.name,
      label = mission.missionTypeLabel or mission.missionType,
      description = mission.description,
      thumbnailFile = mission.thumbnailFile,
      previewFiles = {mission.previewFile},
      type = "mission",
      difficulty = mission.additionalAttributes.difficulty,
      bigmapCycleProgressKeys = mission.bigmapCycleProgressKeys,
      unlocks = mission.unlocks,
      quickTravelAvailable = qtEnabled and true,
      quickTravelUnlocked = qtEnabled and gameplay_missions_progress.missionHasQuickTravelUnlocked(elemData.missionId),
      branchTagsSorted = tableKeysSorted(mission.unlocks.branchTags),
      -- these two will show below the mission and will be a context translation.
      aggregatePrimary = {
        --label = {txt = 'Test', context = {}},
        --value = {txt = 'general.onlyValue', context = {value = '99m'}}
      },
      aggregateSecondary = {
        --label = {txt = 'ui.apps.gears.name', context = {}},
        --value = {txt = 'general.onlyValue', context = {value = '12345'}}
      },
      devMission = mission.devMission or false,

      --[[ rating can have different types: attempts, done, new, stars, with context data.
      rating = {type = 'attempts', attempts = 12345}, -- show attempts: 12345 in this case
      --rating = {type = 'stars', stars = 2}, -- show stars: 2 in this case
      --rating = {type = 'done'}, -- show done
      --rating = {type = 'new'}, -- show new
      ]]
      canSetRoute = true,
    }
    ret.formattedProgress =  gameplay_missions_progress.formatSaveDataForUi(elemData.missionId)
    ret.leaderboardKey = mission.defaultLeaderboardKey or 'recent'


    for key, val in pairs(gameplay_missions_progress.formatSaveDataForBigmap(mission.id) or {}) do
      ret[key] = val
    end
    return ret
  end
  return nil
end

Callers

@/lua/ge/extensions/freeroam/bigMapPoiProvider.lua
local function processMissionPoi(poi, groupData, playerPos, distanceFilter, difficultyValues)
  local formatted = M.formatMissionForBigmap(poi.data)
  local filterData = {
@/lua/ge/extensions/freeroam/vueBigMap.lua
-- Format mission for bigmap
local function formatMissionForBigmap(elemData)
  local mission = gameplay_missions_missions.getMissionById(elemData.missionId)
local function processMissionPoi(poi, groupData)
  local formatted = formatMissionForBigmap(poi.data)
  local filterData = {