Add "Default opacity" setting for touch controller

This commit is contained in:
redphx
2024-05-07 17:37:49 +07:00
parent b9355d5c01
commit 2df3bb4611
6 changed files with 55 additions and 7 deletions

View File

@@ -484,6 +484,18 @@ BxLogger.info('patchRemotePlayMkb', ${configsVar});
str = str.replace(text, text + newCode);
return str;
},
patchTouchControlDefaultOpacity(str: string) {
const text = 'opacityMultiplier:1';
if (!str.includes(text)) {
return false;
}
const opacity = (getPref(PrefKey.STREAM_TOUCH_CONTROLLER_DEFAULT_OPACITY) / 100).toFixed(1);
const newCode = `opacityMultiplier: ${opacity}`;
str = str.replace(text, newCode);
return str;
},
};
let PATCH_ORDERS: PatchArray = [
@@ -534,6 +546,7 @@ let PLAYING_PATCH_ORDERS: PatchArray = [
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',
STATES.hasTouchSupport && getPref(PrefKey.STREAM_TOUCH_CONTROLLER_DEFAULT_OPACITY) !== 100 && 'patchTouchControlDefaultOpacity',
BX_FLAGS.EnableXcloudLogging && 'enableConsoleLogging',