GE Lua Documentation

Press F to search!

getMissionsAtCurrentLocationFormatted

Definition


-- @/lua/ge/extensions/gameplay/missions/missionScreen.lua:162

-- gets all the missions at the current location (mission marker), and returns them in a list already formatted.
local function getMissionsAtCurrentLocationFormatted()
  if not gameplay_playmodeMarkers.isStateWithPlaymodeMarkers() then return nil end
  local dataToSend = {}
  local currentInteractableElements = gameplay_markerInteraction.getCurrentInteractableElements()
  if not currentInteractableElements then return end

  for _, m in ipairs(currentInteractableElements) do
    if m.missionId then
      table.insert(dataToSend, M.formatMission(gameplay_missions_missions.getMissionById(m.missionId)))
    end
  end
  for _, m in ipairs(gameplay_missions_missions.get()) do
    --table.insert(dataToSend, M.formatMission(gameplay_missions_missions.getMissionById(m.id)))
  end
  table.sort(dataToSend, gameplay_missions_unlocks.depthIdSort)
  return dataToSend
end

Callers

@/lua/ge/extensions/gameplay/missions/missionScreen.lua
    else
      missions = M.getMissionsAtCurrentLocationFormatted()
    end