Disable walking when an inputfield is focused (#234)

* feat(phone) Disable walking when an input is focused

* refactor(phone) renamed var & replaced copy paste code

Instead of copying the code it now uses a custom hook

* refactor(phone/input): removed useMemo from hook

* style(phone/input): changed indentation to spaces & added de-structured import
This commit is contained in:
Jan Lecoutere authored and GitHub committed 2021-05-24 12:22:00 -04:00
1 parent 0e1d7f40b5
commit 870aeda3c3
16 files changed
+88 -13

No files matched your search

+8
View File
@@ -180,6 +180,14 @@ on(`__cfx_nui:${PhoneEvents.CLOSE_PHONE}`, async (data: any, cb: Function) => {
cb();
}); // Called for when the phone is closed via the UI.
RegisterNuiCallbackType(PhoneEvents.TOGGLE_KEYS);
on(`__cfx_nui:${PhoneEvents.TOGGLE_KEYS}`, async (data: any, cb: Function) => {
if (isPhoneOpen) {
SetNuiFocusKeepInput(data.keepGameFocus);
}
cb();
});
// setTick(async () => {
// while (config.SwimDestroy) {
// await Delay(config.RunRate * 1000);