mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-20 17:41:37 +00:00
Merge 2225a26016 into 7e60406373
This commit is contained in:
commit
fead921428
2 changed files with 30 additions and 2 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue