Compare commits

...

6 Commits

5 changed files with 19 additions and 16 deletions

View File

@ -1895,10 +1895,10 @@ class Preferences {
migrate: function(savedPrefs, value) { migrate: function(savedPrefs, value) {
try { try {
value = parseInt(value); value = parseInt(value);
if (value < 100) { if (value !== 0 && value < 100) {
value *= 1024000; value *= 1024000;
} }
this.set(PrefKey.BITRATE_VIDEO_MAX, value); this.set(PrefKey.BITRATE_VIDEO_MAX, value, true);
savedPrefs[PrefKey.BITRATE_VIDEO_MAX] = value; savedPrefs[PrefKey.BITRATE_VIDEO_MAX] = value;
} catch (e) { } catch (e) {
} }
@ -2206,10 +2206,11 @@ class Preferences {
const savedPrefs = JSON.parse(savedPrefsStr); const savedPrefs = JSON.parse(savedPrefsStr);
for (let settingId in Preferences.SETTINGS) { for (let settingId in Preferences.SETTINGS) {
const setting = Preferences.SETTINGS[settingId]; const setting = Preferences.SETTINGS[settingId];
setting.ready && setting.ready.call(this, setting);
if (setting.migrate && settingId in savedPrefs) { if (setting.migrate && settingId in savedPrefs) {
setting.migrate.call(this, savedPrefs, savedPrefs[settingId]); setting.migrate.call(this, savedPrefs, savedPrefs[settingId]);
delete setting.migrate;
} }
setting.ready && setting.ready.call(this, setting);
} }
for (let settingId in Preferences.SETTINGS) { for (let settingId in Preferences.SETTINGS) {
const setting = Preferences.SETTINGS[settingId]; const setting = Preferences.SETTINGS[settingId];
@ -2270,10 +2271,10 @@ class Preferences {
} }
return this.#prefs[key]; return this.#prefs[key];
} }
set(key, value) { set(key, value, skipSave) {
value = this.#validateValue(key, value); value = this.#validateValue(key, value);
this.#prefs[key] = value; this.#prefs[key] = value;
this.#updateStorage(); !skipSave && this.#updateStorage();
return value; return value;
} }
#updateStorage() { #updateStorage() {
@ -3780,6 +3781,7 @@ var BxExposed = {
} }
if (touchControllerAvailability === "off") { if (touchControllerAvailability === "off") {
supportedInputTypes = supportedInputTypes.filter((i) => i !== InputType.CUSTOM_TOUCH_OVERLAY && i !== InputType.GENERIC_TOUCH); supportedInputTypes = supportedInputTypes.filter((i) => i !== InputType.CUSTOM_TOUCH_OVERLAY && i !== InputType.GENERIC_TOUCH);
titleInfo.details.supportedTabs = [];
} }
titleInfo.details.hasTouchSupport = supportedInputTypes.includes(InputType.NATIVE_TOUCH) || supportedInputTypes.includes(InputType.CUSTOM_TOUCH_OVERLAY) || supportedInputTypes.includes(InputType.GENERIC_TOUCH); titleInfo.details.hasTouchSupport = supportedInputTypes.includes(InputType.NATIVE_TOUCH) || supportedInputTypes.includes(InputType.CUSTOM_TOUCH_OVERLAY) || supportedInputTypes.includes(InputType.GENERIC_TOUCH);
if (!titleInfo.details.hasTouchSupport && touchControllerAvailability === "all") { if (!titleInfo.details.hasTouchSupport && touchControllerAvailability === "all") {
@ -5111,7 +5113,7 @@ var resizeVideoPlayer = function() {
height = Math.floor(height); height = Math.floor(height);
$video.style.width = `${width}px`; $video.style.width = `${width}px`;
$video.style.height = `${height}px`; $video.style.height = `${height}px`;
$video.style.objectFit = "fill"; $video.style.objectFit = "scale-down";
} else { } else {
$video.style.width = "100%"; $video.style.width = "100%";
$video.style.height = "100%"; $video.style.height = "100%";

View File

@ -491,7 +491,7 @@ function resizeVideoPlayer() {
// Update size // Update size
$video.style.width = `${width}px`; $video.style.width = `${width}px`;
$video.style.height = `${height}px`; $video.style.height = `${height}px`;
$video.style.objectFit = 'fill'; $video.style.objectFit = 'scale-down';
} else { } else {
$video.style.width = '100%'; $video.style.width = '100%';
$video.style.height = '100%'; $video.style.height = '100%';

View File

@ -59,6 +59,7 @@ type XcloudTitleInfo = {
details: { details: {
productId: string; productId: string;
supportedInputTypes: InputType[]; supportedInputTypes: InputType[];
supportedTabs: any[];
hasTouchSupport: boolean; hasTouchSupport: boolean;
hasFakeTouchSupport: boolean; hasFakeTouchSupport: boolean;
hasMkbSupport: boolean; hasMkbSupport: boolean;

View File

@ -1,5 +1,4 @@
import { ControllerShortcut } from "@/modules/controller-shortcut"; import { ControllerShortcut } from "@/modules/controller-shortcut";
import { GameBar } from "@modules/game-bar/game-bar";
import { BxEvent } from "@utils/bx-event"; import { BxEvent } from "@utils/bx-event";
import { STATES } from "@utils/global"; import { STATES } from "@utils/global";
import { getPref, PrefKey } from "@utils/preferences"; import { getPref, PrefKey } from "@utils/preferences";
@ -49,11 +48,11 @@ export const BxExposed = {
gamepadFound && (touchControllerAvailability = 'off'); gamepadFound && (touchControllerAvailability = 'off');
} }
if (touchControllerAvailability === 'off') { if (touchControllerAvailability === 'off') {
// Disable touch on all games (not native touch) // Disable touch on all games (not native touch)
supportedInputTypes = supportedInputTypes.filter(i => i !== InputType.CUSTOM_TOUCH_OVERLAY && i !== InputType.GENERIC_TOUCH); supportedInputTypes = supportedInputTypes.filter(i => i !== InputType.CUSTOM_TOUCH_OVERLAY && i !== InputType.GENERIC_TOUCH);
// Empty TABs
titleInfo.details.supportedTabs = [];
} }
// Pre-check supported input types // Pre-check supported input types

View File

@ -344,11 +344,10 @@ export class Preferences {
migrate: function(savedPrefs: any, value: any) { migrate: function(savedPrefs: any, value: any) {
try { try {
value = parseInt(value); value = parseInt(value);
if (value < 100) { if (value !== 0 && value < 100) {
value *= 1024 * 1000; value *= 1024 * 1000;
} }
this.set(PrefKey.BITRATE_VIDEO_MAX, value, true);
this.set(PrefKey.BITRATE_VIDEO_MAX, value);
savedPrefs[PrefKey.BITRATE_VIDEO_MAX] = value; savedPrefs[PrefKey.BITRATE_VIDEO_MAX] = value;
} catch (e) {} } catch (e) {}
}, },
@ -701,11 +700,13 @@ export class Preferences {
for (let settingId in Preferences.SETTINGS) { for (let settingId in Preferences.SETTINGS) {
const setting = Preferences.SETTINGS[settingId]; const setting = Preferences.SETTINGS[settingId];
setting.ready && setting.ready.call(this, setting);
if (setting.migrate && settingId in savedPrefs) { if (setting.migrate && settingId in savedPrefs) {
setting.migrate.call(this, savedPrefs, savedPrefs[settingId]); setting.migrate.call(this, savedPrefs, savedPrefs[settingId]);
delete setting.migrate;
} }
setting.ready && setting.ready.call(this, setting);
} }
for (let settingId in Preferences.SETTINGS) { for (let settingId in Preferences.SETTINGS) {
@ -783,11 +784,11 @@ export class Preferences {
return this.#prefs[key]; return this.#prefs[key];
} }
set(key: PrefKey, value: any): any { set(key: PrefKey, value: any, skipSave?: boolean): any {
value = this.#validateValue(key, value); value = this.#validateValue(key, value);
this.#prefs[key] = value; this.#prefs[key] = value;
this.#updateStorage(); !skipSave && this.#updateStorage();
return value; return value;
} }