Files
community_bridge/modules/Progressbar/ox_progressbars/client.lua
T
MrNewb 92f6d42555 0.0.10
Aligned folder names with table names for most parts. Temporarily removed unfinished ox_core compatibility. Added missing tables to init.lua, updated manifest to reflect new folder names, and incremented version number.
2025-01-09 03:55:10 -05:00

38 lines
1.5 KiB
Lua

if BridgeClientConfig.ProgressBar ~= "ox" then return end
Progressbar = {}
local _progBarType = BridgeClientConfig.ProgressBarStyle or "bar"
Progressbar.StartProgressBar = function(time, label, whiledead, cancancel, disable, animTable, successAction, canceledAction)
local runTime = time or 10000
local textLabel = label or "Doing something"
local deadBool = whiledead or false
local cancelBool = cancancel or false
local disableKeys = disable or { move = true, sprint = true, car = true, combat = true, }
local anim = animTable or nil
local success = successAction or function() Prints.Debug("Success") end
local canceled = canceledAction or function() Prints.Debug("Cancelled") end
if _progBarType == "bar" then
if exports.ox_lib:progressBar({
duration = runTime,
label = textLabel,
useWhileDead = deadBool,
canCancel = cancelBool,
disable = disableKeys,
anim = anim,
}) then success() else canceled() end
elseif _progBarType == "circle" then
if exports.ox_lib:progressCircle({
duration = runTime,
label = textLabel,
position = 'bottom',
useWhileDead = deadBool,
canCancel = cancelBool,
disable = disableKeys,
anim = anim,
}) then success() else canceled() end
end
end
Progressbar.IsProgressBarActive = function()
return exports.ox_lib:progressActive()
end