GE Lua Documentation

Press F to search!

getScenarioHighscores

Definition


-- @/lua/ge/extensions/core/highscores.lua:38

local function getScenarioHighscores(levelName, scenarioName, configKey)
  local scores = M.getHighscores()

  if scores == nil then return {} end
  scores = scores[levelName]

  if scores == nil then return {} end
  scores = scores[scenarioName]

  if scores == nil then return {} end
  scores = scores[configKey]


  if scores == nil then return {} end
  table.sort(scores, function (a,b) return (a.timeInMillis < b.timeInMillis) end)

  for i,v in ipairs(scores) do
    v.place = i
  end

  return scores
end

Callers

@/ui/modules/busRoute/busRoute.js

    var luaCmd = 'core_highscores.getScenarioHighscores("'
    luaCmd = luaCmd + $scope.selections.route.file.levelName + '","'
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/raceHighscoresLap.lua
        )
      local scores = core_highscores.getScenarioHighscores(
        getCurrentLevelIdentifier(),
@/lua/ge/extensions/core/highscores.lua
local function setScenarioHighscoresCustom(timeInMillis, record, levelName, scenarioName, configKey)
  local currentHighscores = getScenarioHighscores(levelName,scenarioName,configKey)
  timeInMillis = math.floor(timeInMillis+.5)
@/lua/ge/extensions/scenario/quickRace.lua
  local place = core_highscores.setScenarioHighscoresCustom(final.finalTime*1000, record ,scenario.levelName,scenario.scenarioName,M.getConfigKey())
  local scores = core_highscores.getScenarioHighscores(scenario.levelName, scenario.scenarioName, M.getConfigKey())
  if scenario.highscores == nil then
  scenario.highscores.place = place
  scenario.highscores.singleScores = core_highscores.getScenarioHighscores(scenario.levelName, scenario.scenarioName, M.getConfigKey(false,nil,0))
  for _,v in ipairs(scenario.highscores.singleRound) do
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/raceEndScreen.lua
    scenario.highscores.place = place
    --[[scenario.highscores.singleScores = core_highscores.getScenarioHighscores(getCurrentLevelIdentifier(), self.mgr.activity.missionTypeData.trackName, getConfigKey(false,nil,0,race))
    for _,v in ipairs(scenario.highscores.singleRound) do
@/ui/modules/quickrace/quickrace.js

    var luaCmd = 'core_highscores.getScenarioHighscores("'
    luaCmd = luaCmd + $scope.selections.level.file.levelName + '","'
@/ui/modules/lightrunner/lightrunner.js

        var luaCmd = 'core_highscores.getScenarioHighscores("'
        luaCmd = luaCmd + $scope.selections.level.file.levelName + '","'
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/raceHighscoresComplete.lua
        )
      local scores = core_highscores.getScenarioHighscores(
        getCurrentLevelIdentifier(),