mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-12 16:09:16 +02:00
Set background image's quality
This commit is contained in:
@@ -63,6 +63,11 @@ export class LoadingScreen {
|
||||
// Limit max width to reduce image size
|
||||
imageUrl = imageUrl + '?w=1920';
|
||||
|
||||
const imageQuality = getPref(PrefKey.UI_IMAGE_QUALITY);
|
||||
if (imageQuality !== 90) {
|
||||
imageUrl += '&q=' + imageQuality;
|
||||
}
|
||||
|
||||
$bgStyle.textContent! += compressCss(`
|
||||
#game-stream {
|
||||
background-color: transparent !important;
|
||||
|
@@ -1103,6 +1103,18 @@ ${subsVar} = subs;
|
||||
|
||||
return str;
|
||||
},
|
||||
|
||||
setBackgroundImageQuality(str: string) {
|
||||
let index = str.indexOf('}?w=${');
|
||||
index > -1 && (index = PatcherUtils.indexOf(str, '}', index + 1, 10, true));
|
||||
|
||||
if (index < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
str = PatcherUtils.insertAt(str, index, `&q=${getPref(PrefKey.UI_IMAGE_QUALITY)}`);
|
||||
return str;
|
||||
}
|
||||
};
|
||||
|
||||
let PATCH_ORDERS = PatcherUtils.filterPatches([
|
||||
@@ -1116,7 +1128,10 @@ let PATCH_ORDERS = PatcherUtils.filterPatches([
|
||||
'gameCardCustomIcons',
|
||||
// 'gameCardPassTitle',
|
||||
|
||||
getPref(PrefKey.UI_IMAGE_QUALITY) < 90 && 'setImageQuality',
|
||||
...(getPref(PrefKey.UI_IMAGE_QUALITY) < 90 ? [
|
||||
'setImageQuality',
|
||||
'setBackgroundImageQuality',
|
||||
] : []),
|
||||
|
||||
'modifyPreloadedState',
|
||||
|
||||
|
Reference in New Issue
Block a user