mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-06 21:28:27 +02:00
Remove non-cloud games from touch games list
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { STATES } from "@utils/global";
|
||||
import { UserAgent } from "@utils/user-agent";
|
||||
import { BxLogger } from "./bx-logger";
|
||||
import { GALLERY_TOUCH_GAMES, TouchController } from "@modules/touch-controller";
|
||||
import { TouchController } from "@modules/touch-controller";
|
||||
import { GamePassCloudGallery } from "./gamepass-gallery";
|
||||
|
||||
const LOG_TAG = 'PreloadState';
|
||||
|
||||
@@ -29,10 +30,19 @@ export function overridePreloadState() {
|
||||
// Add list of games with custom layouts to the official list
|
||||
if (STATES.hasTouchSupport) {
|
||||
TouchController.updateCustomList();
|
||||
const customList = TouchController.getCustomList();
|
||||
let customList = TouchController.getCustomList();
|
||||
|
||||
try {
|
||||
state.xcloud.sigls[GALLERY_TOUCH_GAMES]?.data.products.push(...customList);
|
||||
const sigls = state.xcloud.sigls;
|
||||
if (GamePassCloudGallery.TOUCH in sigls) {
|
||||
const allGames = sigls[GamePassCloudGallery.ALL].data.products;
|
||||
|
||||
// Remove non-cloud games from the list
|
||||
customList = customList.filter(id => allGames.includes(id));
|
||||
|
||||
// Add to the official list
|
||||
sigls[GamePassCloudGallery.TOUCH]?.data.products.push(...customList);
|
||||
}
|
||||
} catch (e) {
|
||||
BxLogger.error(LOG_TAG, e);
|
||||
}
|
||||
|
Reference in New Issue
Block a user