Remove example scripts and update core logic
Deleted all files in the examples directory to clean up unused or test scripts. Updated fxmanifest.lua to enable ox_lib initialization. Improved error handling and entity tracking in utility functions, added prop removal, and made minor localization and code style adjustments throughout the codebase. Significant reword of inventory module, notification module, and framework module. Added support for wasabi_uikit, added support for keep-progressbars,
This commit is contained in:
1 parent
c40a260ea2
commit
343af95794
100 files changed
+2403
-2755
No files matched your search
@@ -0,0 +1,18 @@
|
||||
---@diagnostic disable: duplicate-set-field
|
||||
local resourceName = "default"
|
||||
ProgressBar = ProgressBar or {}
|
||||
|
||||
---This function opens a progress bar.
|
||||
---@param options table
|
||||
---@param cb any
|
||||
---@param isQBInput boolean||optional
|
||||
---@return boolean
|
||||
function ProgressBar.Open(options, cb, isQBInput)
|
||||
return true, print("No supported progress bar system found.")
|
||||
end
|
||||
|
||||
ProgressBar.GetResourceName = function()
|
||||
return resourceName
|
||||
end
|
||||
|
||||
return ProgressBar
|
||||
@@ -0,0 +1,71 @@
|
||||
---@diagnostic disable: duplicate-set-field
|
||||
local resourceName = "keep-progressbar"
|
||||
local configValue = BridgeClientConfig.ProgressBarSystem
|
||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||
|
||||
ProgressBar = ProgressBar or {}
|
||||
|
||||
---This function converts a QB progress bar options table to an Ox progress bar options table.
|
||||
---@param options table
|
||||
---@return table
|
||||
local function convertFromQB(options)
|
||||
if not options then return options end
|
||||
local prop1 = options.prop or {}
|
||||
local prop2 = options.propTwo or {}
|
||||
local props = {
|
||||
{
|
||||
model = prop1.model,
|
||||
bone = prop1.bone,
|
||||
pos = prop1.coords,
|
||||
rot = prop1.rotation,
|
||||
},
|
||||
{
|
||||
model = prop2.model,
|
||||
bone = prop2.bone,
|
||||
pos = prop2.coords,
|
||||
rot = prop2.rotation,
|
||||
}
|
||||
}
|
||||
return {
|
||||
duration = options.duration,
|
||||
label = options.label,
|
||||
position = 'bottom',
|
||||
useWhileDead = options.useWhileDead,
|
||||
canCancel = options.canCancel,
|
||||
disable = {
|
||||
move = options.controlDisables?.disableMovement,
|
||||
car = options.controlDisables?.disableCarMovement,
|
||||
combat = options.controlDisables?.disableCombat,
|
||||
mouse = options.controlDisables?.disableMouse
|
||||
},
|
||||
anim = {
|
||||
dict = options.animation?.animDict,
|
||||
clip = options.animation?.anim,
|
||||
flag = options.animation?.flags or 49,
|
||||
},
|
||||
prop = props,
|
||||
}
|
||||
end
|
||||
|
||||
---This function opens a progress bar.
|
||||
---@param options table
|
||||
---@param cb any
|
||||
---@param isQBInput boolean||optional
|
||||
---@return boolean
|
||||
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['keep-progressbar']:ox_lib_progressBar(options) or exports['keep-progressbar']:ox_lib_progressBar(options)
|
||||
|
||||
if cb then cb(success) end
|
||||
return success
|
||||
end
|
||||
|
||||
ProgressBar.GetResourceName = function()
|
||||
return resourceName
|
||||
end
|
||||
|
||||
return ProgressBar
|
||||
@@ -65,7 +65,7 @@ function ProgressBar.Open(options, cb, isQBInput)
|
||||
end
|
||||
|
||||
ProgressBar.GetResourceName = function()
|
||||
return "ox_lib"
|
||||
return resourceName
|
||||
end
|
||||
|
||||
return ProgressBar
|
||||
@@ -0,0 +1,71 @@
|
||||
---@diagnostic disable: duplicate-set-field
|
||||
local resourceName = "wasabi_uikit"
|
||||
local configValue = BridgeClientConfig.ProgressBarSystem
|
||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||
|
||||
ProgressBar = ProgressBar or {}
|
||||
|
||||
---This function converts a QB progress bar options table to an Ox progress bar options table.
|
||||
---@param options table
|
||||
---@return table
|
||||
local function convertFromQB(options)
|
||||
if not options then return options end
|
||||
local prop1 = options.prop or {}
|
||||
local prop2 = options.propTwo or {}
|
||||
local props = {
|
||||
{
|
||||
model = prop1.model,
|
||||
bone = prop1.bone,
|
||||
pos = prop1.coords,
|
||||
rot = prop1.rotation,
|
||||
},
|
||||
{
|
||||
model = prop2.model,
|
||||
bone = prop2.bone,
|
||||
pos = prop2.coords,
|
||||
rot = prop2.rotation,
|
||||
}
|
||||
}
|
||||
return {
|
||||
duration = options.duration,
|
||||
label = options.label,
|
||||
position = 'bottom',
|
||||
useWhileDead = options.useWhileDead,
|
||||
canCancel = options.canCancel,
|
||||
disable = {
|
||||
move = options.controlDisables?.disableMovement,
|
||||
car = options.controlDisables?.disableCarMovement,
|
||||
combat = options.controlDisables?.disableCombat,
|
||||
mouse = options.controlDisables?.disableMouse
|
||||
},
|
||||
anim = {
|
||||
dict = options.animation?.animDict,
|
||||
clip = options.animation?.anim,
|
||||
flag = options.animation?.flags or 49,
|
||||
},
|
||||
prop = props,
|
||||
}
|
||||
end
|
||||
|
||||
---This function opens a progress bar.
|
||||
---@param options table
|
||||
---@param cb any
|
||||
---@param isQBInput boolean||optional
|
||||
---@return boolean
|
||||
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.wasabi_uikit:ProgressBar(options, 'circle') or exports.wasabi_uikit:ProgressBar(options, 'bar')
|
||||
|
||||
if cb then cb(success) end
|
||||
return success
|
||||
end
|
||||
|
||||
ProgressBar.GetResourceName = function()
|
||||
return resourceName
|
||||
end
|
||||
|
||||
return ProgressBar
|
||||
Reference in new issue
Block a user