Files
red-valley/resources/[framework]/[depends]/wasabi_bridge/customize/client/progressbar.lua
2026-03-29 21:41:17 +03:00

46 lines
2.0 KiB
Lua

-----------------For support, scripts, and more----------------
--------------- https://discord.gg/wasabiscripts -------------
---------------------------------------------------------------
-- Checking for if Complete UI Kit is running
-- Get it here: https://wasabiscripts.com/product/7037645
local wasabi_uikit, uikitFound = GetResourceState('wasabi_uikit'), false
if wasabi_uikit == 'started' or wasabi_uikit == 'starting' then uikitFound = true end
-- Modify this with whatever progress bar/circle/both you want
---Displays a running progress based on its type.
---@param type "progressBar" | "progressCircle" | string
---@param data table Same data as used in ox_lib progress bar/circle. Subject to change.
---@return boolean
function WSB.progressUI(data, type)
local QBCore = exports['qb-core']:GetCoreObject()
local success = false
QBCore.Functions.Progressbar(data.name or 'progress', data.label or 'Loading...', data.duration or 5000, data.useWhileDead or false, data.canCancel or false, {
disableMovement = data.disable and data.disable.move or false,
disableCarMovement = data.disable and data.disable.car or false,
disableMouse = data.disable and data.disable.mouse or false,
disableCombat = data.disable and data.disable.combat or false,
}, data.anim or {}, data.prop or {}, data.propTwo or {}, function()
success = true
end, function()
success = false
end)
while success == false do
Wait(100)
end
return success
end
-- Compatibility functions for ox_lib
function WSB.progressCircle(data) return WSB.progressUI(data, 'progressCircle') end
function WSB.progressBar(data) return WSB.progressUI(data, 'progressBar') end
exports('progressUI', WSB.progressUI) -- Export for use in other scripts
exports('progressCircle', function(data) return WSB.progressUI(data, 'progressCircle') end) -- Export for use in other scripts
exports('progressBar', function(data) return WSB.progressUI(data, 'progressBar') end) -- Export for use in other scripts