feat: progress bar for refilling air and config for durations of progress bars
This commit is contained in:
+20
-7
@@ -22,12 +22,25 @@ lib.callback.register('qbx_divegear:client:fillTank', function()
|
||||
return false
|
||||
end
|
||||
|
||||
oxygenLevel = Config.OxygenLevel
|
||||
exports.qbx_core:Notify(Lang:t("success.tube_filled"), 'success')
|
||||
if currentGear.enabled then
|
||||
enableScuba()
|
||||
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
|
||||
return true
|
||||
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,
|
||||
|
||||
+4
-1
@@ -1,2 +1,5 @@
|
||||
Config = {}
|
||||
Config.OxygenLevel = 100 -- in seconds
|
||||
Config.OxygenLevel = 100 -- in seconds
|
||||
Config.PutOnSuitTimeMs = 5000
|
||||
Config.TakeOffSuitTimeMs = 5000
|
||||
Config.RefillTankTimeMs = 5000
|
||||
@@ -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!",
|
||||
|
||||
Reference in New Issue
Block a user