Compare commits

...

4 Commits

Author SHA1 Message Date
886a23e5ac Bump version to 3.0.5 2024-01-21 12:27:57 +07:00
309feca3f9 Only set "pointerEvents" property on touch-supported devices 2024-01-21 11:55:17 +07:00
82a9a91534 Fix Clarity Boost warning not working 2024-01-21 11:32:52 +07:00
7248dac3f6 Fix patches 2024-01-21 11:15:09 +07:00
2 changed files with 32 additions and 18 deletions

View File

@ -1,5 +1,5 @@
// ==UserScript==
// @name Better xCloud
// @namespace https://github.com/redphx
// @version 3.0.4
// @version 3.0.5
// ==/UserScript==

View File

@ -1,7 +1,7 @@
// ==UserScript==
// @name Better xCloud
// @namespace https://github.com/redphx
// @version 3.0.4
// @version 3.0.5
// @description Improve Xbox Cloud Gaming (xCloud) experience
// @author redphx
// @license MIT
@ -13,7 +13,7 @@
// ==/UserScript==
'use strict';
const SCRIPT_VERSION = '3.0.4';
const SCRIPT_VERSION = '3.0.5';
const SCRIPT_HOME = 'https://github.com/redphx/better-xcloud';
const ENABLE_XCLOUD_LOGGER = false;
@ -6808,7 +6808,7 @@ if (window.BX_VIBRATION_INTENSITY && window.BX_VIBRATION_INTENSITY < 1) {
];
// Enable native Mouse and Keyboard support
if (getPref(Preferences.MKB_ENABLED)) {
if (ENABLE_NATIVE_MKB_BETA) {
newSettings.push('EnableMouseAndKeyboard: true');
newSettings.push('ShowMouseKeyboardSetting: true');
@ -6900,17 +6900,25 @@ if (window.BX_VIBRATION_INTENSITY && window.BX_VIBRATION_INTENSITY < 1) {
getPref(Preferences.UI_LAYOUT) === 'tv' && ['tvLayout'],
ENABLE_XCLOUD_LOGGER && ['enableXcloudLogger'],
ENABLE_XCLOUD_LOGGER && [
'enableXcloudLogger',
'enableConsoleLogging',
],
getPref(Preferences.BLOCK_TRACKING) && [
'disableTrackEvent',
'blockWebRtcStatsCollector',
],
getPref(Preferences.REMOTE_PLAY_ENABLED) && [
'remotePlayDirectConnectUrl',
'remotePlayKeepAlive',
],
[
'overrideSettings',
getPref(Preferences.REMOTE_PLAY_ENABLED) && 'remotePlayDirectConnectUrl',
getPref(Preferences.BLOCK_TRACKING) && 'disableTrackEvent',
ENABLE_NATIVE_MKB_BETA && 'mkbIsMouseAndKeyboardTitle',
HAS_TOUCH_SUPPORT && 'patchUpdateInputConfigurationAsync',
ENABLE_NATIVE_MKB_BETA && getPref(Preferences.MKB_ENABLED) && 'mkbIsMouseAndKeyboardTitle',
ENABLE_XCLOUD_LOGGER && 'enableConsoleLogging',
getPref(Preferences.REMOTE_PLAY_ENABLED) && 'remotePlayKeepAlive',
getPref(Preferences.BLOCK_TRACKING) && 'blockWebRtcStatsCollector',
],
];
@ -6924,7 +6932,7 @@ if (window.BX_VIBRATION_INTENSITY && window.BX_VIBRATION_INTENSITY < 1) {
[
'disableGamepadDisconnectedScreen',
ENABLE_NATIVE_MKB_BETA && getPref(Preferences.MKB_ENABLED) && 'mkbMouseAndKeyboardEnabled',
ENABLE_NATIVE_MKB_BETA && 'mkbMouseAndKeyboardEnabled',
],
];
@ -7027,6 +7035,10 @@ if (window.BX_VIBRATION_INTENSITY && window.BX_VIBRATION_INTENSITY < 1) {
static #cleanupPatches() {
for (let groupIndex = Patcher.#PATCH_ORDERS.length - 1; groupIndex >= 0; groupIndex--) {
const group = Patcher.#PATCH_ORDERS[groupIndex];
if (group === false) {
Patcher.#PATCH_ORDERS.splice(groupIndex, 1);
continue;
}
for (let patchIndex = group.length - 1; patchIndex >= 0; patchIndex--) {
const patchName = group[patchIndex];
@ -7830,11 +7842,11 @@ div[class*=StreamMenu-module__menuContainer] > div[class*=Menu-module] {
overflow: hidden;
}
.bx-quick-settings-tab-contents div:not([data-clarity-boost="true"]) .bx-clarity-boost-warning {
.bx-quick-settings-bar:not([data-clarity-boost="true"]) .bx-clarity-boost-warning {
display: none;
}
.bx-quick-settings-tab-contents div[data-clarity-boost="true"] .bx-clarity-boost-warning {
.bx-quick-settings-bar[data-clarity-boost="true"] .bx-clarity-boost-warning {
display: block;
margin: 0px 8px;
padding: 12px;
@ -7844,7 +7856,7 @@ div[class*=StreamMenu-module__menuContainer] > div[class*=Menu-module] {
border-radius: 4px;
}
.bx-quick-settings-tab-contents div[data-clarity-boost="true"] > div[data-type="video"] {
.bx-quick-settings-bar[data-clarity-boost="true"] div[data-type="video"] {
display: none;
}
@ -8878,7 +8890,7 @@ function interceptHttpRequests() {
overrides.inputConfiguration = overrides.inputConfiguration || {};
overrides.inputConfiguration.enableVibration = true;
if (ENABLE_NATIVE_MKB_BETA) {
overrides.inputConfiguration.enableMouseAndKeyboard = getPref(Preferences.MKB_ENABLED);
overrides.inputConfiguration.enableMouseAndKeyboard = true;
}
// Enable touch controller
@ -9384,8 +9396,10 @@ function cloneStreamHudButton($orgButton, label, svg_icon) {
}
};
$container.addEventListener('transitionstart', onTransitionStart);
$container.addEventListener('transitionend', onTransitionEnd);
if (HAS_TOUCH_SUPPORT) {
$container.addEventListener('transitionstart', onTransitionStart);
$container.addEventListener('transitionend', onTransitionEnd);
}
const $button = $container.querySelector('button');
$button.setAttribute('title', label);