GE Lua Documentation

Press F to search!

requestExitLoadingScreen

Definition


-- @/lua/ge/extensions/core/gamestate.lua:127

local function requestExitLoadingScreen(tagName, ignoreMenuswitch)
  if tagName == nil then return end
  --dump(loadingScreenRequests)
  --print(debug.tracesimple())
  log('D', logTag, 'exiting : ' .. tagName)
  if not loadingScreenRequests[tagName] then log('W', logTag, 'trying to exit state we haven\'t been in before -please check your code') end
  loadingScreenRequests[tagName] = false

  if containsOnly(loadingScreenRequests, false)  then
    SFXSystem.setGlobalParameter("g_GameLoading", 0)
    SFXSystem.setGlobalParameter("g_FadeTimeMS", 1000) -- fade time in milliseconds

    -- new loading screen
    local showMainMenu = sendShowMainMenu()
    log('D', logTag, 'sending hide loading screen; showing main menu (' .. tostring(showMainMenu) .. ')')
    guihooks.trigger("LoadingScreen", {
      active = false,
      gotoMainMenu = showMainMenu,
      gameState = M.state
    })
    if showMainMenu then
      resetGameState()
    end

    listeners = {}
    loadingActive = false
  end
end

Callers

@/lua/ge/serverConnection.lua
  if p then p:add("disconnectActual.filename") end
  if loadingScreen then core_gamestate.requestExitLoadingScreen(logTag) end
  if p then p:add("disconnectActual.requestExitLoadingScreen") end
@/lua/ge/extensions/core/levels.lua
      log('E', '', 'Expanded mission file is invalid: "'..dumps(expandedLevelPath)..'" from "'..tostring(levelPath)..'"')
      core_gamestate.requestExitLoadingScreen('')
      return false
    server.createGame(expandedLevelPath, customLoadingFunction)
    core_gamestate.requestExitLoadingScreen('')
  end
@/lua/ge/extensions/freeroam/freeroam.lua
    startFreeroamHelper(level, startPointName, spawnVehicle, customLoadingFunction)
    core_gamestate.requestExitLoadingScreen(logTag)
  end
@/lua/ge/server/server.lua

  core_gamestate.requestExitLoadingScreen(logTag)
@/lua/ge/main.lua
      log('D', 'gamestate', 'Checking material finished loading')
      core_gamestate.requestExitLoadingScreen('worldReadyState')
      -- switch the UI to play mode