GE Lua Documentation

Press F to search!

onActivityAcceptGatherData

Definition


-- @/lua/ge/extensions/freeroam/facilities.lua:448



local function onActivityAcceptGatherData(elemData, activityData)
  for _, elem in ipairs(elemData) do
    if elem.facility then
      local data = {
        icon = elem.facility.playModeIconName or elem.facility.icon,
        heading = elem.facility.name,
        preheadings = {facilityTypeToUiLabelSingular[elem.facility.type]},
        sorting = {
          type = elem.type,
          id = elem.id
        }
      }
      if elem.type == "garage" then
        data.buttonLabel = "ui.career.openGarageTitle"
        data.buttonFun = function() gameplay_garageMode.start(true) end
        table.insert(activityData, data)
      end
      -- gasStations are handled in gasStations.lua now
      if elem.type == "dealership" then
        data.buttonLabel = "View Inventory"
        data.buttonFun = function() career_modules_vehicleShopping.openShop(elem.facility.id) end
        data.props = {}
        for _, prop in ipairs(elem.facility.activityAcceptProps or {}) do
          table.insert(data.props,{
            icon = prop.icon or "checkmark",
            keyLabel = prop.keyLabel,
            valueLabel = prop.valueLabel,
          })
        end
        table.insert(activityData, data)
      end
      if elem.type == "computer" then
        data.props = {}
        for _, prop in ipairs(elem.facility.activityAcceptProps or {}) do
          table.insert(data.props,{
            icon = prop.icon or "checkmark",
            keyLabel = prop.keyLabel,
            valueLabel = prop.valueLabel,
          })
        end
        data.buttonLabel = "Use Computer"
        data.buttonFun = function()
          if career_career.isActive() then
            career_modules_computer.openMenu(elem.facility, true)
          end
        end
        table.insert(activityData, data)
      end
      if elem.type == "dragstrip" then
        data.props = {}
        for _, prop in ipairs(elem.facility.activityAcceptProps or {}) do
          table.insert(data.props,{
           icon = prop.icon or "drag02",
           keyLabel = prop.keyLabel,
           valueLabel = prop.valueLabel,
         })
        end
        data.buttonLabel = "View History"
        data.buttonFun = function()
          gameplay_drag_dragBridge.openHistoryScreen(elem.facility)
        end

        table.insert(activityData, data)
      end
    end
  end
end

Callers

@/lua/ge/extensions/freeroam/gasStations.lua

local function onActivityAcceptGatherData(elemData, activityData)
  for _, elem in ipairs(elemData) do
@/lua/ge/extensions/career/modules/inspectVehicle.lua

local function onActivityAcceptGatherData(elemData, activityData)
  for _, elem in ipairs(elemData) do
@/lua/ge/extensions/career/modules/delivery/general.lua

local function onActivityAcceptGatherData(elemData, activityData)
  for _, elem in ipairs(elemData) do
@/lua/ge/extensions/gameplay/crawl/general.lua

local function onActivityAcceptGatherData(elemData, activityData)
  for _, elem in ipairs(elemData) do
@/lua/ge/extensions/gameplay/missions/missions.lua

local function onActivityAcceptGatherData(elemData, activityData)
  local missionElems = {}
@/lua/ge/extensions/core/sounds.lua

local function onActivityAcceptGatherData(elemData, activityData)
  audioBlurLog('I','AUDIO',string.format("onActivityAcceptGatherData: elemData = %s, activityData = %s",dumps(elemData),(activityData)))