This commit is contained in:
VCRhythm 2026-10-16 22:31:24 +00:00 • committed by GitHub
commit fead921428
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 30 additions and 2 deletions

View file

@ -32,8 +32,10 @@ Making a new release? Simply add the new header with the version and date undern
## Unreleased
* LocalizationTables no longer report as changed when nothing changes. [(#1333)]
* Fixed the plugin preloading its notification sound as an image, which printed "Asset type does not match requested type" in Studio. ([#1344])
[#1333]: https://github.com/rojo-rbx/rojo/pull/1333
[#1344]: https://github.com/rojo-rbx/rojo/pull/1344
## [7.7.1] (October 1st, 2026)

View file

@ -21,12 +21,38 @@ function gatherAssetUrlsRecursive(currentTable, currentUrls)
end
local function preloadAssets()
local contentUrls = gatherAssetUrlsRecursive(Assets)
local contentUrls = {}
local soundUrls = {}
for key, value in Assets do
if key == "Sounds" then
gatherAssetUrlsRecursive(value, soundUrls)
elseif typeof(value) == "string" then
table.insert(contentUrls, value)
elseif typeof(value) == "table" then
gatherAssetUrlsRecursive(value, contentUrls)
end
end
Log.trace("Preloading assets: {:?}", contentUrls)
Log.trace("Preloading sounds: {:?}", soundUrls)
-- PreloadAsync fetches a bare string as an image, so sounds go in as Sound
-- instances, which load their SoundId as audio.
local preloadList = table.clone(contentUrls)
local sounds = {}
for _, soundId in soundUrls do
local sound = Instance.new("Sound")
sound.SoundId = soundId
table.insert(sounds, sound)
table.insert(preloadList, sound)
end
coroutine.wrap(function()
ContentProvider:PreloadAsync(contentUrls)
ContentProvider:PreloadAsync(preloadList)
for _, sound in sounds do
sound:Destroy()
end
end)()
end