Skip to content

Commit

Permalink
refactor(imports/streaming): remove default timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed Jan 17, 2024
1 parent 6817ae6 commit 0f7d1c1
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions imports/requestAnimDict/client.lua
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions imports/requestAnimSet/client.lua
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions imports/requestModel/client.lua
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions imports/requestNamedPtfxAsset/client.lua
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions imports/requestScaleformMovie/client.lua
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions imports/requestStreamedTextureDict/client.lua
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions imports/requestWeaponAsset/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 0f7d1c1

Please sign in to comment.