more documentation

This commit is contained in:
MrNewb committed 2025-03-03 01:37:29 -05:00
1 parent 79ca0bc65a
commit ce1903b7d6
15 files changed
+140 -106

No files matched your search

+9 -64
View File
@@ -1,65 +1,3 @@
-- if BridgeClientConfig.ProgressBar ~= "qb" then return end
-- Progressbar = {}
-- local function convertOxToQB(disabledTable, animTable)
-- local repackedTable = { disabled = {}, animations = {}}
-- for _, v in pairs(disabledTable) do
-- if v.move then
-- repackedTable.disabled.disableMovement = v.move
-- end
-- if v.car then
-- repackedTable.disabled.disableCarMovement = v.car
-- end
-- if v.combat then
-- repackedTable.disabled.disableCombat = v.combat
-- end
-- if v.mouse then
-- repackedTable.disabled.disableMouse = v.mouse
-- end
-- end
-- for _, v in pairs(animTable) do
-- if v.dict then
-- repackedTable.animations.animDict = v.animDict
-- end
-- if v.clip then
-- repackedTable.animations.anim = v.anim
-- end
-- end
-- return repackedTable
-- end
-- 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 success = successAction or function() Prints.Debug("Success") end
-- local canceled = canceledAction or function() Prints.Debug("Cancelled") end
-- local repackedTable = convertOxToQB(disable, animTable)
-- exports['progressbar']:Progress({
-- name = textLabel,
-- duration = runTime,
-- label = textLabel,
-- useWhileDead = deadBool,
-- canCancel = cancelBool,
-- controlDisables = repackedTable.disabled,
-- animation = repackedTable.animations,
-- prop = {},
-- propTwo = {}
-- }, function(cancelled)
-- if not cancelled then
-- success()
-- else
-- canceled()
-- end
-- end)
-- end
-- Progressbar.IsProgressBarActive = function()
-- return exports["progressbar"]:isDoingSomething()
-- end
if GetResourceState('progressbar') ~= 'started' or (BridgeClientConfig.ProgressBarSystem ~= "qb" and BridgeClientConfig.ProgressBarSystem ~= "auto") then return end
ProgressBar = ProgressBar or {}
@@ -98,18 +36,24 @@ local function convertFromOx(options)
}
end
---comment
---@param options table
---@param cb any
---@param qbFormat boolean
---@return nil
function ProgressBar.Open(options, cb, qbFormat)
if not exports['progressbar'] then return false end
if not qbFormat then
options = convertFromOx(options)
end
exports['progressbar']:Progress(options, cb)
end
-- Example usage:
--[[
RegisterCommand("progressbar", function()
ProgressBar.Open({
duration = 5000,
@@ -131,3 +75,4 @@ RegisterCommand("progressbar", function()
print(cancelled and "Cancelled" or "Complete")
end)
end)
--]]