requestEnterLoadingScreen
Definition
-- @/lua/ge/extensions/core/gamestate.lua:87
local function requestEnterLoadingScreen(tagName, func)
if tagName == nil then return end
if noUiMode then
log('I', logTag, 'headless mode, skipping loading screen')
local func = func or nop
func() -- calling the func right away
return
end
local first = containsOnly(loadingScreenRequests, false)
log('D', logTag, 'loading screen request from: ' .. tagName .. '; value before was: ' .. tostring(loadingScreenRequests[tagName]))
if loadingScreenRequests[tagName] then log('D', logTag, 'trying to enter state we are already in: ' .. tostring(tagName)) end
loadingScreenRequests[tagName] = true
func = func or nop
if first and not loadingActive then
log('D', logTag, 'sending show loading screen')
guihooks.trigger("LoadingScreen", { active = true }) -- new loading screen
if GFXDevice.devicePresent() and not headless_mode then
waitingForUIChangeToLoading = true
end
SFXSystem.setGlobalParameter("g_GameLoading", 1)
SFXSystem.setGlobalParameter("g_FadeTimeMS", 1000) -- fade time in milliseconds
end
if loadingActive then
log('D', logTag, 'exec fun direct')
func()
else
table.insert(listeners, func)
log('D', logTag, 'ui initialised (' .. tostring(UIInitialised) .. ')')
log('D', logTag, 'waiting for ui (' .. tostring(waitingForUIToBeInitialised) .. ')')
if not UIInitialised then
waitingForUIToBeInitialised = true
end
end
end
Callers
@/lua/ge/serverConnection.lua
if loadingScreen then
core_gamestate.requestEnterLoadingScreen(logTag, help)
if p then p:add("disconnectWrapper.requestEnterLoadingScreen") end
@/lua/ge/server/server.lua
-- yes this is weird, but it fixes the problem with createGame and luaPreRender
core_gamestate.requestEnterLoadingScreen(logTag, help)
core_gamestate.requestEnterLoadingScreen('worldReadyState')
core_gamestate.requestEnterLoadingScreen(logTag, help)
core_gamestate.requestEnterLoadingScreen('worldReadyState')
if __cefcontext_ == -1 then
@/lua/ge/extensions/core/levels.lua
if core_gamestate.getLoadingStatus('') then return end
core_gamestate.requestEnterLoadingScreen('')
local function help ()
@/lua/ge/extensions/freeroam/freeroam.lua
local function startFreeroam(level, startPointName, wasDelayed, spawnVehicle, customLoadingFunction)
core_gamestate.requestEnterLoadingScreen(logTag)
-- if this was a delayed start, load the FGs now.