Add "patchStreamHud" patch

This commit is contained in:
redphx 2024-04-11 17:12:15 +07:00
parent ae24005f08
commit 8286429cc3

View File

@ -8249,6 +8249,22 @@ if (gamepadFound) {
funcStr = funcStr.replace(text, 'this.useCombinedAudioVideoStream=true');
return funcStr;
},
patchStreamHud: function(funcStr) {
const text = 'let{onCollapse';
if (!funcStr.includes(text)) {
return false;
}
// Restore the "..." button
funcStr = funcStr.replace(text, 'e.guideUI = null;' + text);
// Remove the TAK Edit button when the touch controller is disabled
if (getPref(Preferences.STREAM_TOUCH_CONTROLLER) === 'off') {
funcStr = funcStr.replace(text, 'e.canShowTakHUD = false;' + text);
}
return funcStr;
},
};
static #PATCH_ORDERS = [
@ -8291,6 +8307,8 @@ if (gamepadFound) {
getPref(Preferences.REMOTE_PLAY_ENABLED) && ['remotePlayConnectMode'],
getPref(Preferences.REMOTE_PLAY_ENABLED) && ['remotePlayGuideWorkaround'],
['patchStreamHud'],
['playVibration'],
HAS_TOUCH_SUPPORT && getPref(Preferences.STREAM_TOUCH_CONTROLLER) === 'all' && ['exposeTouchLayoutManager'],
HAS_TOUCH_SUPPORT && (getPref(Preferences.STREAM_TOUCH_CONTROLLER) === 'off' || getPref(Preferences.STREAM_TOUCH_CONTROLLER_AUTO_OFF)) && ['disableTakRenderer'],