refactor(client/interface): nui focus tweaks

Add helper functions to set nui focus and restore previous input state.
Ensure focus is reset before triggering responses (promises/callbacks).
This commit is contained in:
Linden committed 2023-03-01 07:25:28 +11:00
1 parent 284b563483
commit 3dd996c38b
4 files changed
+33 -40

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
local keepInput = IsNuiFocusKeepingInput()
function lib.setNuiFocus(allowInput, disableCursor)
keepInput = IsNuiFocusKeepingInput()
SetNuiFocus(true, not disableCursor)
SetNuiFocusKeepInput(allowInput)
end
function lib.resetNuiFocus()
SetNuiFocus(false, false)
SetNuiFocusKeepInput(keepInput)
end