feat: progress bar for refilling air and config for durations of progress bars

This commit is contained in:
unknown
2023-11-09 22:30:54 -08:00
parent 5bf410321a
commit 75d54d7df5
3 changed files with 25 additions and 8 deletions
+15 -2
View File
@@ -22,12 +22,25 @@ lib.callback.register('qbx_divegear:client:fillTank', function()
return false
end
if lib.progressBar({
duration = Config.RefillTankTimeMs,
label = Lang:t("info.filling_air"),
useWhileDead = false,
canCancel = true,
anim = {
dict = "clothingshirt",
clip = "try_shirt_positive_d",
blendIn = 8.0
}
}) then
oxygenLevel = Config.OxygenLevel
exports.qbx_core:Notify(Lang:t("success.tube_filled"), 'success')
if currentGear.enabled then
enableScuba()
end
return true
end
end)
local function deleteGear()
@@ -61,7 +74,7 @@ end
local function takeOffSuit()
if lib.progressBar({
duration = 5000,
duration = Config.TakeOffSuitTimeMs,
label = Lang:t("info.pullout_suit"),
useWhileDead = false,
canCancel = true,
@@ -134,7 +147,7 @@ local function putOnSuit()
end
if lib.progressBar({
duration = 5000,
duration = Config.PutOnSuitTimeMs,
label = Lang:t("info.put_suit"),
useWhileDead = false,
canCancel = true,
+3
View File
@@ -1,2 +1,5 @@
Config = {}
Config.OxygenLevel = 100 -- in seconds
Config.PutOnSuitTimeMs = 5000
Config.TakeOffSuitTimeMs = 5000
Config.RefillTankTimeMs = 5000
+1
View File
@@ -12,6 +12,7 @@ local Translations = {
info = {
put_suit = "Putting on your diving suit...",
pullout_suit = "Taking off your diving suit...",
filling_air = "Filling air"
},
warning = {
oxygen_one_minute = "You have less than one minute of air remaining!",