RFR: Renamed file, adjusted manifest, and refactored code.

Renamed the event so its more clear what it does and added a bool to denote when it's being disabled or not. This was attached to `isPhoneOpen` which wasn't reliablly working.  Its now done within `showPhone` and `hidePhone`.

The wait was changed from `1000` to `100` in the event the phone is opened before the wait is over. Makes it more smooth as there is no longer a small duration where the mouse moves the camera.

Removed the enable of control actions as it wasn't needed.
This commit is contained in:
Darrian committed 2021-04-22 12:32:10 -04:00
1 parent 1c69cd5e2e
commit 95ed68dff6
4 files changed
+27 -35

No files matched your search

+2 -2
View File
@@ -59,6 +59,7 @@ const showPhone = async (): Promise<void> => {
sendMessage('PHONE', PhoneEvents.SET_TIME, time);
SetNuiFocus(true, true);
SetNuiFocusKeepInput(true);
emit('npwd:disableControlActions', true);
};
const hidePhone = async (): Promise<void> => {
@@ -67,6 +68,7 @@ const hidePhone = async (): Promise<void> => {
await phoneCloseAnim();
SetNuiFocus(false, false);
SetNuiFocusKeepInput(false);
emit('npwd:disableControlActions', false);
};
/* * * * * * * * * * * * *
@@ -106,10 +108,8 @@ async function Phone(): Promise<void> {
}
if (isPhoneOpen) {
await hidePhone();
emit('npwd:disableEnableInput');
} else {
await showPhone();
emit('npwd:disableEnableInput');
}
}