feat(global): major fixes...i dont even know that to call this commit so ill just say its global. Who even cares

This commit is contained in:
Dillon Skaggs authored and GitHub committed 2021-07-06 23:10:47 +02:00
1 parent f6395e4b8e
commit 104fda2c11
10 files changed
+22 -28

No files matched your search

+3 -11
View File
@@ -20,11 +20,9 @@ function fetchOnInitialize() {
sendMessage('PHONE', PhoneEvents.SET_CONFIG, config);
}
if (config.general.enableMultiChar) {
onNet(PhoneEvents.ON_INIT, () => {
fetchOnInitialize();
});
}
onNet(PhoneEvents.ON_INIT, () => {
fetchOnInitialize();
});
RegisterKeyMapping('phone', 'Open Phone', 'keyboard', 'f1');
@@ -125,12 +123,6 @@ AddEventHandler('onResourceStop', function (resource: string) {
}
});
RegisterNuiCallbackType(PhoneEvents.UI_IS_READY);
on(`__cfx_nui:${PhoneEvents.UI_IS_READY}`, (_data: any, cb: Function) => {
fetchOnInitialize();
cb();
});
// DO NOT CHANGE THIS EITHER, PLEASE - CHIP
// ^ AND WHAT ARE YOU GOING TO DO HUH? - KIDZ
+7 -2
View File
@@ -29,9 +29,11 @@ const displayHelperText = () => {
EndTextCommandDisplayHelp(0, true, false, -1);
};
RegisterNuiCallbackType(PhotoEvents.TAKE_PHOTO);
on(`__cfx_nui:${PhotoEvents.TAKE_PHOTO}`, async (data: any, cb: Function) => {
cb();
emit('npwd:disableControlActions', false);
// Create Phone Prop
let frontCam = false;
CreateMobilePhone(1);
@@ -46,7 +48,6 @@ on(`__cfx_nui:${PhotoEvents.TAKE_PHOTO}`, async (data: any, cb: Function) => {
while (inCameraMode) {
await Delay(0);
displayHelperText();
if (IsControlJustPressed(1, 27)) {
frontCam = !frontCam;
CellFrontCamActivate(frontCam);
@@ -55,12 +56,16 @@ on(`__cfx_nui:${PhotoEvents.TAKE_PHOTO}`, async (data: any, cb: Function) => {
} else if (IsControlJustPressed(1, 177)) {
handleCameraExit();
break;
}
}
displayHelperText();
}
ClearHelp(true);
emit('npwd:disableControlActions', true);
});
const handleTakePicture = async () => {
// Wait a frame so we don't draw the display helper text
await Delay(0);
takePhoto();
await Delay(200);
DestroyMobilePhone();