- Documentation
- Client events
- onClientTransferBoxProgressChange
Event
onClientTransferBoxProgressChange
File download progress (a resource start or downloadFile), at most about 10 times per second. Useful for your own download bar.
Handler
addEventHandler("onClientTransferBoxProgressChange", root, function(downloadedSizeTotal, downloadTotalBytes) ... end)Parameters
downloadedSizeTotalint- Downloaded bytes.
downloadTotalBytesint- Total bytes.
Source
source is root.
Example
local done, total = 0, 0
addEventHandler("onClientTransferBoxProgressChange", root, function(d, t) done, total = d, t end)
addEventHandler("onClientRender", root, function()
if total > 0 and done < total then
dxDrawRectangle(20, 20, 300 * done / total, 10, tocolor(255, 122, 34))
end
end)
See also
isTransferBoxActiveChecks whether the client is downloading resource files right now (a resource start ordownloadFile).downloadFileDownloads a resource file marked inmeta.xmlas<file src="..." download="false"/>only when it is needed (e.g. a large music file). The result arrives in theonClientFileDownloadCompleteevent, always asynchronously, also when the file was already downloaded.":resource/file"downloads another resource's file.