From 7a202ba8a7926a0b85ba361d243d9f91e8a401b1 Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Mon, 18 Sep 2023 08:10:52 +0700 Subject: [PATCH] Disable "Visual quality" setting on unsupported browsers --- better-xcloud.user.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/better-xcloud.user.js b/better-xcloud.user.js index 0157dd1..cd26f74 100644 --- a/better-xcloud.user.js +++ b/better-xcloud.user.js @@ -3591,7 +3591,13 @@ function injectSettingsButton($parent) { } // Disable unsupported settings - if (!HAS_TOUCH_SUPPORT) { + if (settingId === Preferences.STREAM_CODEC_PROFILE) { + const options = Preferences.SETTINGS[Preferences.STREAM_CODEC_PROFILE].options; + if (Object.keys(options).length <= 1) { + $control.disabled = true; + $control.title = __('browser-unsupported-feature'); + } + } else if (!HAS_TOUCH_SUPPORT) { // Disable this setting for non-touchable devices if ([Preferences.STREAM_TOUCH_CONTROLLER, Preferences.STREAM_TOUCH_CONTROLLER_STYLE_STANDARD, Preferences.STREAM_TOUCH_CONTROLLER_STYLE_CUSTOM].indexOf(settingId) > -1) { $control.disabled = true;