Scripts/resources/[standalone]/ox_lib/imports/requestStreamedTextureDict/client.lua

16 lines
719 B
Lua
Raw Normal View History

2024-12-29 20:02:43 +00:00
---Load a texture dictionary. When called from a thread, it will yield until it has loaded.
---@param textureDict string
2024-12-30 10:15:34 +00:00
---@param timeout number? Approximate milliseconds to wait for the dictionary to load. Default is 10000.
---@return string textureDict
2024-12-29 20:02:43 +00:00
function lib.requestStreamedTextureDict(textureDict, timeout)
if HasStreamedTextureDictLoaded(textureDict) then return textureDict end
if type(textureDict) ~= 'string' then
error(("expected textureDict to have type 'string' (received %s)"):format(type(textureDict)))
end
2024-12-30 10:15:34 +00:00
return lib.streamingRequest(RequestStreamedTextureDict, HasStreamedTextureDictLoaded, 'textureDict', textureDict, timeout)
2024-12-29 20:02:43 +00:00
end
return lib.requestStreamedTextureDict