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
+20 -7
View File
@@ -22,12 +22,25 @@ lib.callback.register('qbx_divegear:client:fillTank', function()
return false return false
end end
oxygenLevel = Config.OxygenLevel if lib.progressBar({
exports.qbx_core:Notify(Lang:t("success.tube_filled"), 'success') duration = Config.RefillTankTimeMs,
if currentGear.enabled then label = Lang:t("info.filling_air"),
enableScuba() 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
return true
end) end)
local function deleteGear() local function deleteGear()
@@ -61,7 +74,7 @@ end
local function takeOffSuit() local function takeOffSuit()
if lib.progressBar({ if lib.progressBar({
duration = 5000, duration = Config.TakeOffSuitTimeMs,
label = Lang:t("info.pullout_suit"), label = Lang:t("info.pullout_suit"),
useWhileDead = false, useWhileDead = false,
canCancel = true, canCancel = true,
@@ -134,7 +147,7 @@ local function putOnSuit()
end end
if lib.progressBar({ if lib.progressBar({
duration = 5000, duration = Config.PutOnSuitTimeMs,
label = Lang:t("info.put_suit"), label = Lang:t("info.put_suit"),
useWhileDead = false, useWhileDead = false,
canCancel = true, canCancel = true,
+4 -1
View File
@@ -1,2 +1,5 @@
Config = {} Config = {}
Config.OxygenLevel = 100 -- in seconds Config.OxygenLevel = 100 -- in seconds
Config.PutOnSuitTimeMs = 5000
Config.TakeOffSuitTimeMs = 5000
Config.RefillTankTimeMs = 5000
+1
View File
@@ -12,6 +12,7 @@ local Translations = {
info = { info = {
put_suit = "Putting on your diving suit...", put_suit = "Putting on your diving suit...",
pullout_suit = "Taking off your diving suit...", pullout_suit = "Taking off your diving suit...",
filling_air = "Filling air"
}, },
warning = { warning = {
oxygen_one_minute = "You have less than one minute of air remaining!", oxygen_one_minute = "You have less than one minute of air remaining!",