GE Lua Documentation

Press F to search!

updateLoadingProgress

Definition


-- @/lua/ge/main.lua:1083

function updateLoadingProgress(val, txt)
  local msg = string.format("[{val: %u%%, txt: %s}]", math.floor(100 * val), txt)

  guihooks.trigger("UpdateProgress", msg) -- the Json object is inside an array as it is the first argument of the function :)

  local loadingLevel = TorqueScriptLua.getBoolVar("$loadingLevel")

  if loadingLevel then
    local canvas = scenetree.findObject("Canvas")
    if canvas then
      canvas:repaintUIThrottled()
    end
  end
  setConsoleVariable("$lastProgress", val)
  setConsoleVariable("$$lastProgressTxt", txt)
end

Callers

@/lua/ge/main.lua
    -- %msg = translate("ui.loading.spawn.collada", "Importing 3D stuff") .. " ...";
    updateLoadingProgress(progress, msg)
  end