From 58b83c4eb27c56ed9386c71a173411b98f2270dc Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Wed, 17 Jul 2024 17:38:59 +0700 Subject: [PATCH] Add BX_EXPOSED.backButtonPressed() --- src/utils/bx-exposed.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/utils/bx-exposed.ts b/src/utils/bx-exposed.ts index 472c2ad..936833e 100644 --- a/src/utils/bx-exposed.ts +++ b/src/utils/bx-exposed.ts @@ -4,6 +4,7 @@ import { deepClone, STATES } from "@utils/global"; import { getPref, PrefKey } from "@utils/preferences"; import { BxLogger } from "./bx-logger"; import { BX_FLAGS } from "./bx-flags"; +import { StreamSettings } from "@/modules/stream/stream-settings"; export enum InputType { CONTROLLER = 'Controller', @@ -117,4 +118,14 @@ export const BxExposed = { }, disableGamepadPolling: false, + + backButtonPressed: () => { + const streamSettings = StreamSettings.getInstance(); + if (streamSettings.isShowing()) { + streamSettings.hide(); + return true; + } + + return false; + }, };