more documentation
This commit is contained in:
1 parent
79ca0bc65a
commit
ce1903b7d6
15 files changed
+140
-106
No files matched your search
@@ -1,43 +1,3 @@
|
||||
-- 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
|
||||
|
||||
|
||||
if GetResourceState('ox_lib') ~= 'started' or (BridgeClientConfig.ProgressBarSystem ~= "ox" and BridgeClientConfig.InputSystem ~= "auto") then return end
|
||||
ProgressBar = ProgressBar or {}
|
||||
|
||||
@@ -81,18 +41,24 @@ local function convertFromQB(options)
|
||||
}
|
||||
end
|
||||
|
||||
---comment
|
||||
---@param options table
|
||||
---@param cb any
|
||||
---@param isQBInput boolean
|
||||
---@return nil
|
||||
function ProgressBar.Open(options, cb, isQBInput)
|
||||
if isQBInput then
|
||||
options = convertFromQB(options)
|
||||
end
|
||||
|
||||
|
||||
local style = options.style or 'bar'
|
||||
local success = style == 'circle' and exports.ox_lib:progressCircle(options) or exports.ox_lib:progressBar(options)
|
||||
|
||||
|
||||
if cb then cb(not success) end
|
||||
return success
|
||||
end
|
||||
|
||||
--[[
|
||||
RegisterCommand("progressbar", function()
|
||||
ProgressBar.Open({
|
||||
duration = 5000,
|
||||
@@ -109,3 +75,4 @@ RegisterCommand("progressbar", function()
|
||||
print(cancelled and "Cancelled" or "Complete")
|
||||
end)
|
||||
end)
|
||||
--]]
|
||||
Reference in new issue
Block a user