mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-07 16:17:20 +02:00
Add back the "Off" option for "Touch controller > Availability" setting
This commit is contained in:
parent
ac08f657bb
commit
b11a89037a
@ -7216,6 +7216,7 @@ class Preferences {
|
|||||||
'options': {
|
'options': {
|
||||||
'default': t('default'),
|
'default': t('default'),
|
||||||
'all': t('tc-all-games'),
|
'all': t('tc-all-games'),
|
||||||
|
'off': t('off'),
|
||||||
},
|
},
|
||||||
'unsupported': !HAS_TOUCH_SUPPORT,
|
'unsupported': !HAS_TOUCH_SUPPORT,
|
||||||
'ready': () => {
|
'ready': () => {
|
||||||
@ -8005,7 +8006,11 @@ if (window.BX_VIBRATION_INTENSITY && window.BX_VIBRATION_INTENSITY < 1) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const newCode = `
|
let newCode = '';
|
||||||
|
if (getPref(Preferences.STREAM_TOUCH_CONTROLLER) === 'off') {
|
||||||
|
newCode = 'return;';
|
||||||
|
} else {
|
||||||
|
newCode = `
|
||||||
const gamepads = window.navigator.getGamepads();
|
const gamepads = window.navigator.getGamepads();
|
||||||
let gamepadFound = false;
|
let gamepadFound = false;
|
||||||
|
|
||||||
@ -8020,6 +8025,7 @@ if (gamepadFound) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
funcStr = funcStr.replace(text, newCode + text);
|
funcStr = funcStr.replace(text, newCode + text);
|
||||||
return funcStr;
|
return funcStr;
|
||||||
@ -8069,7 +8075,7 @@ if (gamepadFound) {
|
|||||||
|
|
||||||
['playVibration'],
|
['playVibration'],
|
||||||
HAS_TOUCH_SUPPORT && getPref(Preferences.STREAM_TOUCH_CONTROLLER) === 'all' && ['exposeTouchLayoutManager'],
|
HAS_TOUCH_SUPPORT && getPref(Preferences.STREAM_TOUCH_CONTROLLER) === 'all' && ['exposeTouchLayoutManager'],
|
||||||
HAS_TOUCH_SUPPORT && getPref(Preferences.STREAM_TOUCH_CONTROLLER_AUTO_OFF) && ['disableTakRenderer'],
|
HAS_TOUCH_SUPPORT && (getPref(Preferences.STREAM_TOUCH_CONTROLLER) === 'off' || getPref(Preferences.STREAM_TOUCH_CONTROLLER_AUTO_OFF)) && ['disableTakRenderer'],
|
||||||
|
|
||||||
ENABLE_XCLOUD_LOGGER && ['enableConsoleLogging'],
|
ENABLE_XCLOUD_LOGGER && ['enableConsoleLogging'],
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user