From d55c13ab313d0547db22bdfb2a3c00a51a282928 Mon Sep 17 00:00:00 2001 From: MrNewb <47620135+MrNewb@users.noreply.github.com> Date: Sun, 1 Jun 2025 21:33:40 -0400 Subject: [PATCH] flag no longer hardcoded, also clean up some debug code --- modules/progressbar/ox_lib/client.lua | 32 ++++------------- modules/progressbar/qb-progressbar/client.lua | 36 +++---------------- 2 files changed, 11 insertions(+), 57 deletions(-) diff --git a/modules/progressbar/ox_lib/client.lua b/modules/progressbar/ox_lib/client.lua index c7bdb21..153cb3e 100644 --- a/modules/progressbar/ox_lib/client.lua +++ b/modules/progressbar/ox_lib/client.lua @@ -13,7 +13,7 @@ local function convertFromQB(options) model = prop1.model, bone = prop1.bone, pos = prop1.coords, - rot = prop1.rotation, + rot = prop1.rotation, }, { model = prop2.model, @@ -22,8 +22,6 @@ local function convertFromQB(options) rot = prop2.rotation, } } - - return { duration = options.duration, label = options.label, @@ -38,17 +36,18 @@ local function convertFromQB(options) }, anim = { dict = options.animation?.animDict, - clip = options.animation?.anim + clip = options.animation?.anim, + flag = options.animation?.flags or 49, }, prop = props, } end ----comment +---This function opens a progress bar. ---@param options table ---@param cb any ---@param isQBInput boolean ----@return nil +---@return boolean ---@diagnostic disable-next-line: duplicate-set-field function ProgressBar.Open(options, cb, isQBInput) if isQBInput then @@ -62,23 +61,4 @@ function ProgressBar.Open(options, cb, isQBInput) return success end -return ProgressBar - ---[[ -RegisterCommand("progressbar", function() - ProgressBar.Open({ - duration = 5000, - label = "Searching", - disable = { - move = true, - combat = true - }, - anim = { - dict = "anim@amb@clubhouse@tutorial@bkr_tut_ig3@", - clip = "machinic_loop_mechandplayer" - } - }, function(cancelled) - print(cancelled and "Cancelled" or "Complete") - end) -end) ---]] +return ProgressBar \ No newline at end of file diff --git a/modules/progressbar/qb-progressbar/client.lua b/modules/progressbar/qb-progressbar/client.lua index 4908ff1..a0433fa 100644 --- a/modules/progressbar/qb-progressbar/client.lua +++ b/modules/progressbar/qb-progressbar/client.lua @@ -23,12 +23,12 @@ local function convertFromOx(options) animation = { animDict = options.anim?.dict, anim = options.anim?.clip, - flags = 49 + flags = options.anim?.flag or 49 }, prop = { model = prop1.model, bone = prop1.bone, - coords = prop1.pos, + coords = prop1.pos, rotation = prop1.rot }, propTwo = { @@ -40,11 +40,11 @@ local function convertFromOx(options) } end ----comment +---This function opens a progress bar. ---@param options table ---@param cb any ---@param qbFormat boolean ----@return success boolean +---@return boolean boolean ---@diagnostic disable-next-line: duplicate-set-field function ProgressBar.Open(options, cb, qbFormat) if not exports['progressbar'] then return false end @@ -60,30 +60,4 @@ function ProgressBar.Open(options, cb, qbFormat) return Citizen.Await(prom) end -return ProgressBar - - --- Example usage: ---[[ -RegisterCommand("progressbar", function() - ProgressBar.Open({ - duration = 5000, - label = "Searching", - disable = { - move = true, - combat = true - }, - anim = { - dict = "anim@amb@clubhouse@tutorial@bkr_tut_ig3@", - clip = "machinic_loop_mechandplayer" - }, - prop = { - model = "prop_ar_arrow_3", - pos = vector3(0.0, 0.0, 0.0), - rot = vector3(0.0, 0.0, 0.0) - }, - }, function(cancelled) - print(cancelled and "Cancelled" or "Complete") - end) -end) ---]] +return ProgressBar \ No newline at end of file