Update better-xcloud.user.js

This commit is contained in:
redphx 2024-05-31 07:22:01 +07:00
parent bee190b867
commit a24446a6b4

View File

@ -2683,7 +2683,6 @@ function injectStreamMenuButtons() {
};
let $btnStreamSettings;
let $btnStreamStats;
const PREF_DISABLE_FEEDBACK_DIALOG = getPref(PrefKey.STREAM_DISABLE_FEEDBACK_DIALOG);
const observer = new MutationObserver((mutationList) => {
mutationList.forEach((item2) => {
if (item2.type !== "childList") {
@ -2709,11 +2708,6 @@ function injectStreamMenuButtons() {
BxEvent.dispatch(window, BxEvent.STREAM_ERROR_PAGE);
return;
}
if (PREF_DISABLE_FEEDBACK_DIALOG && $elm.className.startsWith("PostStreamFeedbackScreen")) {
const $btnClose = $elm.querySelector("button");
$btnClose && $btnClose.click();
return;
}
if ($elm.className?.startsWith("StreamMenu-module__container")) {
const $btnCloseHud = document.querySelector("button[class*=StreamMenu-module__backButton]");
if (!$btnCloseHud) {
@ -3975,10 +3969,10 @@ class LoadingScreen {
}
`;
}
LoadingScreen.reset();
setTimeout(LoadingScreen.reset, 2000);
}
static reset() {
LoadingScreen.#$bgStyle && setTimeout(() => LoadingScreen.#$bgStyle.textContent = "", 2000);
LoadingScreen.#$bgStyle && (LoadingScreen.#$bgStyle.textContent = "");
LoadingScreen.#$waitTimeBox && LoadingScreen.#$waitTimeBox.classList.add("bx-gone");
LoadingScreen.#waitTimeInterval && clearInterval(LoadingScreen.#waitTimeInterval);
LoadingScreen.#waitTimeInterval = null;
@ -7715,6 +7709,14 @@ window.dispatchEvent(new Event('${BxEvent.STREAM_SESSION_READY}'))
true` + text;
str2 = str2.replace(text, newCode);
return str2;
},
skipFeedbackDialog(str2) {
const text = "&&this.shouldTransitionToFeedback(";
if (!str2.includes(text)) {
return false;
}
str2 = str2.replace(text, "&& false " + text);
return str2;
}
};
var PATCH_ORDERS = [
@ -7751,6 +7753,7 @@ var PLAYING_PATCH_ORDERS = [
"playVibration",
getPref(PrefKey.AUDIO_ENABLE_VOLUME_CONTROL) && !getPref(PrefKey.STREAM_COMBINE_SOURCES) && "patchAudioMediaStream",
getPref(PrefKey.AUDIO_ENABLE_VOLUME_CONTROL) && getPref(PrefKey.STREAM_COMBINE_SOURCES) && "patchCombinedAudioVideoMediaStream",
getPref(PrefKey.STREAM_DISABLE_FEEDBACK_DIALOG) && "skipFeedbackDialog",
STATES.hasTouchSupport && getPref(PrefKey.STREAM_TOUCH_CONTROLLER) === "all" && "patchShowSensorControls",
STATES.hasTouchSupport && getPref(PrefKey.STREAM_TOUCH_CONTROLLER) === "all" && "exposeTouchLayoutManager",
STATES.hasTouchSupport && (getPref(PrefKey.STREAM_TOUCH_CONTROLLER) === "off" || getPref(PrefKey.STREAM_TOUCH_CONTROLLER_AUTO_OFF)) && "disableTakRenderer",