diff --git a/resource/interface/client/alert.lua b/resource/interface/client/alert.lua index 5d31c86..c2923cc 100644 --- a/resource/interface/client/alert.lua +++ b/resource/interface/client/alert.lua @@ -15,9 +15,8 @@ function lib.alertDialog(data) if alert then return end alert = promise.new() + lib.setNuiFocus(false) - SetNuiFocus(true, true) - SetNuiFocusKeepInput(false) SendNUIMessage({ action = 'sendAlert', data = data @@ -33,8 +32,8 @@ function lib.closeAlertDialog() SendNUIMessage({ action = 'closeAlertDialog' }) - alert:resolve(nil) + alert:resolve(nil) alert = nil end diff --git a/resource/interface/client/input.lua b/resource/interface/client/input.lua index 92eab3d..cbb63c9 100644 --- a/resource/interface/client/input.lua +++ b/resource/interface/client/input.lua @@ -38,7 +38,7 @@ function lib.inputDialog(heading, rows, options) end end - SetNuiFocus(true, true) + lib.setNuiFocus(false) SendNUIMessage({ action = 'openDialog', data = { @@ -53,18 +53,22 @@ end function lib.closeInputDialog() if not input then return end - input:resolve(nil) - input = nil - SetNuiFocus(false, false) + + lib.resetNuiFocus() SendNUIMessage({ action = 'closeInputDialog' }) + + input:resolve(nil) + input = nil end RegisterNUICallback('inputData', function(data, cb) cb(1) - SetNuiFocus(false, false) + lib.resetNuiFocus() + local promise = input input = nil + promise:resolve(data) end) diff --git a/resource/interface/client/radial.lua b/resource/interface/client/radial.lua index e57359c..ed5b9a1 100644 --- a/resource/interface/client/radial.lua +++ b/resource/interface/client/radial.lua @@ -120,8 +120,7 @@ function lib.hideRadial() data = false }) - SetNuiFocus(false, false) - SetNuiFocusKeepInput(false) + lib.setNuiFocus(true) table.wipe(menuHistory) isOpen = false @@ -266,7 +265,7 @@ RegisterNUICallback('radialClose', function(_, cb) if not isOpen then return end - SetNuiFocus(false, false) + lib.resetNuiFocus() isOpen = false currentRadial = nil @@ -314,8 +313,8 @@ lib.addKeybind({ items = menuItems } }) - SetNuiFocus(true, true) - SetNuiFocusKeepInput(true) + + lib.setNuiFocus(false) SetCursorLocation(0.5, 0.5) while isOpen do diff --git a/resource/interface/client/skillcheck.lua b/resource/interface/client/skillcheck.lua index e5890e8..29c456d 100644 --- a/resource/interface/client/skillcheck.lua +++ b/resource/interface/client/skillcheck.lua @@ -10,7 +10,7 @@ function lib.skillCheck(difficulty, inputs) if skillcheck then return end skillcheck = promise:new() - SetNuiFocus(true, false) + lib.setNuiFocus(false, true) SendNUIMessage({ action = 'startSkillCheck', data = { @@ -24,9 +24,11 @@ end RegisterNUICallback('skillCheckOver', function(success, cb) cb(1) + if skillcheck then + lib.resetNuiFocus() + skillcheck:resolve(success) skillcheck = nil - SetNuiFocus(false, false) end end)