From eee8603306791d1439ad826b4936ac242b509239 Mon Sep 17 00:00:00 2001 From: itschip Date: Sat, 1 Jan 2022 21:20:24 +0100 Subject: [PATCH] feat(config): allow configurable toggle key Should introduce a convar for this as well --- config.json | 3 ++- resources/client/cl_main.ts | 2 +- typings/config.ts | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config.json b/config.json index 5417db866..5417bec0d 100644 --- a/config.json +++ b/config.json @@ -5,7 +5,8 @@ "exportFunction": "myCheckerFunction" }, "general": { - "useResourceIntegration": false + "useResourceIntegration": false, + "toggleKey": "f1" }, "database": { "useIdentifierPrefix": false, diff --git a/resources/client/cl_main.ts b/resources/client/cl_main.ts index 1e4a3f8f3..dd3fac181 100644 --- a/resources/client/cl_main.ts +++ b/resources/client/cl_main.ts @@ -26,7 +26,7 @@ onNet(PhoneEvents.SET_PLAYER_LOADED, (state: boolean) => { } }); -RegisterKeyMapping('phone', 'Open Phone', 'keyboard', 'f1'); +RegisterKeyMapping('phone', 'Open Phone', 'keyboard', config.general.toggleKey); const getCurrentGameTime = () => { let hour: string | number = GetClockHours(); diff --git a/typings/config.ts b/typings/config.ts index b903ebc91..656f1e35b 100644 --- a/typings/config.ts +++ b/typings/config.ts @@ -26,6 +26,7 @@ interface Debug { interface General { useDashNumber: boolean; useResourceIntegration: boolean; + toggleKey: string; } interface NotificationConfig {