From 7432e85a9ad31ffe283a5dd80a1b0d65dac14091 Mon Sep 17 00:00:00 2001 From: Christopher Date: Wed, 17 Feb 2021 00:05:59 +0100 Subject: [PATCH] fix(resources/client/photos): fix toggle --- resources/client/cl_photo.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/resources/client/cl_photo.ts b/resources/client/cl_photo.ts index e65bfe7..88cb8eb 100644 --- a/resources/client/cl_photo.ts +++ b/resources/client/cl_photo.ts @@ -35,9 +35,10 @@ function CellFrontCamActivate(activate: boolean) { } const displayHelperText = () => { - BeginTextCommandDisplayHelp('TWOSTRINGS'); + BeginTextCommandDisplayHelp('THREESTRINGS'); AddTextComponentString('Exit Camera Mode: ~INPUT_CELLPHONE_CANCEL~'); - AddTextComponentString('Toggle Front/Back: ~INPUT_PHONE~'); + AddTextComponentString('Open Front camera: ~INPUT_PHONE~'); + AddTextComponentString('Open Rear camera: ~INPUT_CELLPHONE_DOWN~'); EndTextCommandDisplayHelp(0, true, false, -1); }; @@ -59,9 +60,12 @@ on(`__cfx_nui:${events.CAMERA_TAKE_PHOTO}`, async (data: any, cb: Function) => { await Delay(0); let frontCam = false; displayHelperText(); - if (IsControlJustPressed(1, 27)) { - frontCam = !frontCam; - CellFrontCamActivate(frontCam); + if (IsControlJustReleased(1, 27)) { + // selfie + CellFrontCamActivate(true); + } else if (IsControlJustReleased(1, 173)) { + // not selfie, duh + CellFrontCamActivate(false); } else if (IsControlJustPressed(1, 176)) { await handleTakePicture(); } else if (IsControlJustPressed(1, 177)) {