QBCore 进度条插件 NoPixel 4.0风格
- 首先进入 ox_lib/resource/interface/client/progress.lua
- 然后找到函数 lib.progressBar(data)
- 然后在这里用我的代码替换整个函数代码
function lib.progressBar(data)
while progress ~= nil do Wait(0) end
if not interruptProgress(data) then
playerState.invBusy = true
exports['progressbar']:Progress({
name = "random_task",
duration = data.duration,
label = data.label,
useWhileDead = false,
canCancel = true,
controlDisables = {
disableMovement = false,
disableCarMovement = false,
disableMouse = false,
disableCombat = false,
},
}, function(cancelled)
if not cancelled then
-- finished
--SendNUIMessage({
--action = 'progress',
--data = {
--label = data.label,
--duration = data.duration
--duration = -100
--}
--})
progress = nil
playerState.invBusy = false
else
-- cancelled
print("omg")
-- Reset progress whether it's finished or cancelled
progress = false
Citizen.Wait(1000)
progress = nil
playerState.invBusy = false
end
end)
return startProgress(data)
end
end
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
- 最新
- 最热
只看作者