mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
refactor(imports/streaming): remove default timeout
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---Load an animation dictionary. When called from a thread, it will yield until it has loaded.
|
||||
---@param animDict string
|
||||
---@param timeout number? Number of ticks to wait for the dictionary to load. Default is 500.
|
||||
---@param timeout number? Approximate milliseconds to wait for the dictionary to load. Default is 1000.
|
||||
---@return string? animDict
|
||||
function lib.requestAnimDict(animDict, timeout)
|
||||
if HasAnimDictLoaded(animDict) then return animDict end
|
||||
@@ -19,7 +19,7 @@ function lib.requestAnimDict(animDict, timeout)
|
||||
|
||||
return lib.waitFor(function()
|
||||
if HasAnimDictLoaded(animDict) then return animDict end
|
||||
end, ("failed to load animDict '%s'"):format(animDict), timeout or 500)
|
||||
end, ("failed to load animDict '%s'"):format(animDict), timeout)
|
||||
end
|
||||
|
||||
return lib.requestAnimDict
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---Load an animation clipset. When called from a thread, it will yield until it has loaded.
|
||||
---@param animSet string
|
||||
---@param timeout number? Number of ticks to wait for the clipset to load. Default is 500.
|
||||
---@param timeout number? Approximate milliseconds to wait for the clipset to load. Default is 1000.
|
||||
---@return string? animSet
|
||||
function lib.requestAnimSet(animSet, timeout)
|
||||
if HasAnimSetLoaded(animSet) then return animSet end
|
||||
@@ -15,7 +15,7 @@ function lib.requestAnimSet(animSet, timeout)
|
||||
|
||||
return lib.waitFor(function()
|
||||
if HasAnimSetLoaded(animSet) then return animSet end
|
||||
end, ("failed to load animSet '%s'"):format(animSet), timeout or 500)
|
||||
end, ("failed to load animSet '%s'"):format(animSet), timeout)
|
||||
end
|
||||
|
||||
return lib.requestAnimSet
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---Load a model. When called from a thread, it will yield until it has loaded.
|
||||
---@param model number | string
|
||||
---@param timeout number? Number of ticks to wait for the model to load. Default is 500.
|
||||
---@param timeout number? Approximate milliseconds to wait for the model to load. Default is 1000.
|
||||
---@return number? model
|
||||
function lib.requestModel(model, timeout)
|
||||
if not tonumber(model) then model = joaat(model) end
|
||||
@@ -17,7 +17,7 @@ function lib.requestModel(model, timeout)
|
||||
|
||||
return lib.waitFor(function()
|
||||
if HasModelLoaded(model) then return model end
|
||||
end, ("failed to load model '%s'"):format(model), timeout or 500)
|
||||
end, ("failed to load model '%s'"):format(model), timeout)
|
||||
end
|
||||
|
||||
return lib.requestModel
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---Load a named particle effect. When called from a thread, it will yield until it has loaded.
|
||||
---@param ptFxName string
|
||||
---@param timeout number? Number of ticks to wait for the particle effect to load. Default is 500.
|
||||
---@param timeout number? Approximate milliseconds to wait for the particle effect to load. Default is 1000.
|
||||
---@return string? ptFxName
|
||||
function lib.requestNamedPtfxAsset(ptFxName, timeout)
|
||||
if HasNamedPtfxAssetLoaded(ptFxName) then return ptFxName end
|
||||
@@ -15,7 +15,7 @@ function lib.requestNamedPtfxAsset(ptFxName, timeout)
|
||||
|
||||
return lib.waitFor(function()
|
||||
if HasNamedPtfxAssetLoaded(ptFxName) then return ptFxName end
|
||||
end, ("failed to load ptFxName '%s'"):format(ptFxName), timeout or 500)
|
||||
end, ("failed to load ptFxName '%s'"):format(ptFxName), timeout)
|
||||
end
|
||||
|
||||
return lib.requestNamedPtfxAsset
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---Load a scaleform movie. When called from a thread, it will yield until it has loaded.
|
||||
---@param scaleformName string
|
||||
---@param timeout number? Number of ticks to wait for the scaleform movie to load. Default is 500.
|
||||
---@param timeout number? Approximate milliseconds to wait for the scaleform movie to load. Default is 1000.
|
||||
---@return number? scaleform
|
||||
function lib.requestScaleformMovie(scaleformName, timeout)
|
||||
if type(scaleformName) ~= 'string' then
|
||||
@@ -13,7 +13,7 @@ function lib.requestScaleformMovie(scaleformName, timeout)
|
||||
|
||||
return lib.waitFor(function()
|
||||
if HasScaleformMovieLoaded(scaleform) then return scaleform end
|
||||
end, ("failed to load scaleform '%s'"):format(scaleform), timeout or 500)
|
||||
end, ("failed to load scaleform '%s'"):format(scaleform), timeout)
|
||||
end
|
||||
|
||||
return lib.requestScaleformMovie
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---Load a texture dictionary. When called from a thread, it will yield until it has loaded.
|
||||
---@param textureDict string
|
||||
---@param timeout number? Number of ticks to wait for the dictionary to load. Default is 500.
|
||||
---@param timeout number? Approximate milliseconds to wait for the dictionary to load. Default is 1000.
|
||||
---@return string? textureDict
|
||||
function lib.requestStreamedTextureDict(textureDict, timeout)
|
||||
if HasStreamedTextureDictLoaded(textureDict) then return textureDict end
|
||||
@@ -15,7 +15,7 @@ function lib.requestStreamedTextureDict(textureDict, timeout)
|
||||
|
||||
return lib.waitFor(function()
|
||||
if HasStreamedTextureDictLoaded(textureDict) then return textureDict end
|
||||
end, ("failed to load textureDict '%s'"):format(textureDict), timeout or 500)
|
||||
end, ("failed to load textureDict '%s'"):format(textureDict), timeout)
|
||||
end
|
||||
|
||||
return lib.requestStreamedTextureDict
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
---Load a weapon asset. When called from a thread, it will yield until it has loaded.
|
||||
---@param weaponType string | number
|
||||
---@param timeout number? Number of ticks to wait for the asset to load. Default is 500.
|
||||
---@param timeout number? Approximate milliseconds to wait for the asset to load. Default is 1000.
|
||||
---@param weaponResourceFlags WeaponResourceFlags? Default is 31.
|
||||
---@param extraWeaponComponentFlags ExtraWeaponComponentFlags? Default is 0.
|
||||
---@return string | number? weaponType
|
||||
@@ -44,7 +44,7 @@ function lib.requestWeaponAsset(weaponType, timeout, weaponResourceFlags, extraW
|
||||
|
||||
return lib.waitFor(function()
|
||||
if HasWeaponAssetLoaded(weaponType) then return weaponType end
|
||||
end, ("failed to load weaponType '%s'"):format(weaponType), timeout or 500)
|
||||
end, ("failed to load weaponType '%s'"):format(weaponType), timeout)
|
||||
end
|
||||
|
||||
return lib.requestWeaponAsset
|
||||
|
||||
Reference in New Issue
Block a user