mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-21 13:15:50 +00:00
* Switch git submodules to Wally packages * Update build snapshot * Add wally to foreman and use latest versions * Install packages in CI runners * Fix indents * Install packages in the correct directory * Install packages in correct dir of release action too * Remove submodules from ci checkout * Remove submodules from release checkout * Update selene with latest fix * Fix whitespace Co-authored-by: Lucien Greathouse <me@lpghatguy.com>
34 lines
780 B
Lua
34 lines
780 B
Lua
local ContentProvider = game:GetService("ContentProvider")
|
|
|
|
local Packages = script.Parent.Parent.Packages
|
|
local Log = require(Packages.Log)
|
|
|
|
local Assets = require(script.Parent.Assets)
|
|
|
|
local gatherAssetUrlsRecursive
|
|
function gatherAssetUrlsRecursive(currentTable, currentUrls)
|
|
currentUrls = currentUrls or {}
|
|
|
|
for _, value in pairs(currentTable) do
|
|
if typeof(value) == "string" then
|
|
table.insert(currentUrls, value)
|
|
elseif typeof(value) == "table" then
|
|
gatherAssetUrlsRecursive(value)
|
|
end
|
|
end
|
|
|
|
return currentUrls
|
|
end
|
|
|
|
local function preloadAssets()
|
|
local contentUrls = gatherAssetUrlsRecursive(Assets)
|
|
|
|
Log.trace("Preloading assets: {:?}", contentUrls)
|
|
|
|
coroutine.wrap(function()
|
|
ContentProvider:PreloadAsync(contentUrls)
|
|
end)()
|
|
end
|
|
|
|
return preloadAssets
|