Skip to content

Commit

Permalink
Update v2.4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Musiker15 committed Sep 28, 2024
1 parent 58971b3 commit 7ae32f1
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 22 deletions.
5 changes: 5 additions & 0 deletions client/functions/input.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ MSK.Register('msk_core:input', function(source, header, placeholder, field)
return MSK.Input.Open(header, placeholder, field)
end)

MSK.Input.Active = function()
return isInputOpen
end
exports('InputActive', MSK.Input.Active)

RegisterNUICallback('submitInput', function(data)
if data.input == '' then data.input = nil end
if tonumber(data.input) then data.input = tonumber(data.input) end
Expand Down
21 changes: 0 additions & 21 deletions client/functions/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -200,27 +200,6 @@ MSK.GetPedMugshot = function(ped, transparent)
end
exports('GetPedMugshot', MSK.GetPedMugshot)

MSK.Progressbar = function(time, text, color)
SendNUIMessage({
action = 'progressBarStart',
time = time,
text = text or '',
color = color or Config.progressColor,
})
end
MSK.ProgressStart = MSK.Progressbar -- Support for old Scripts
exports('Progressbar', MSK.Progressbar)
exports('ProgressStart', MSK.Progressbar) -- Support for old Scripts
RegisterNetEvent("msk_core:progressbar", MSK.Progressbar)

MSK.ProgressStop = function()
SendNUIMessage({
action = 'progressBarStop',
})
end
exports('ProgressStop', MSK.ProgressStop)
RegisterNetEvent("msk_core:progressbarStop", MSK.ProgressStop)

MSK.LoadAnimDict = function(dict)
assert(dict and DoesAnimDictExist(dict), 'Parameter "dict" is nil or the AnimDict does not exist')

Expand Down
5 changes: 5 additions & 0 deletions client/functions/numpad.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ MSK.Register('msk_core:numpad', function(source, pin, show)
return MSK.Numpad.Open(pin, show)
end)

MSK.Numpad.Active = function()
return isNumpadOpen
end
exports('NumpadActive', MSK.Numpad.Active)

RegisterNUICallback('submitNumpad', function(data)
callback(true)
MSK.Numpad.Close()
Expand Down
41 changes: 41 additions & 0 deletions client/functions/progressbar.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
MSK.Progress = {}

local isProgressOpen = false

MSK.Progress.Start = function(time, text, color)
if isProgressOpen then
MSK.Progress.Stop()
end
isProgressOpen = true

SendNUIMessage({
action = 'progressBarStart',
time = time,
text = text or '',
color = color or Config.progressColor,
})

SetTimeout(time, function()
isProgressOpen = false
end)
end
MSK.Progressbar = MSK.Progress.Start -- Support for old Scripts
exports('Progressbar', MSK.Progress.Start)
exports('ProgressbarStart', MSK.Progress.Start) -- Support for old Scripts
RegisterNetEvent("msk_core:progressbar", MSK.Progress.Start)

MSK.Progress.Stop = function()
SendNUIMessage({
action = 'progressBarStop',
})

isProgressOpen = false
end
MSK.ProgressStop = MSK.Progress.Stop -- Support for old Scripts
exports('ProgressStop', MSK.Progress.Stop) -- Support for old Scripts
RegisterNetEvent("msk_core:progressbarStop", MSK.Progress.Stop)

MSK.Progress.Active = function()
return isProgressOpen
end
exports('ProgressActive', MSK.Progress.Active)
2 changes: 1 addition & 1 deletion fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ games { 'gta5' }
author 'Musiker15 - MSK Scripts'
name 'msk_core'
description 'Functions for MSK Scripts'
version '2.4.7'
version '2.4.8'

lua54 'yes'

Expand Down

0 comments on commit 7ae32f1

Please sign in to comment.