mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-07-19 12:44:27 +02:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e0b04f306f | ||
![]() |
a3c948b070 | ||
![]() |
4e736175b4 | ||
![]() |
cb66340177 |
11
dist/better-xcloud.lite.user.js
vendored
11
dist/better-xcloud.lite.user.js
vendored
File diff suppressed because one or more lines are too long
2
dist/better-xcloud.meta.js
vendored
2
dist/better-xcloud.meta.js
vendored
@@ -1,5 +1,5 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name Better xCloud
|
// @name Better xCloud
|
||||||
// @namespace https://github.com/redphx
|
// @namespace https://github.com/redphx
|
||||||
// @version 6.0.4
|
// @version 6.0.5
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
11
dist/better-xcloud.user.js
vendored
11
dist/better-xcloud.user.js
vendored
File diff suppressed because one or more lines are too long
@@ -7,11 +7,11 @@
|
|||||||
margin-bottom: 0 !important;
|
margin-bottom: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
body[data-media-type=tv] & {
|
body[data-bx-media-type=tv] & {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
body:not([data-media-type=tv]) & {
|
body:not([data-bx-media-type=tv]) & {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|
||||||
> button:first-of-type {
|
> button:first-of-type {
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
|
|
||||||
body[data-media-type=tv] & {
|
body[data-bx-media-type=tv] & {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
button {
|
button {
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
body:not([data-media-type=tv]) & {
|
body:not([data-bx-media-type=tv]) & {
|
||||||
button {
|
button {
|
||||||
span {
|
span {
|
||||||
display: none;
|
display: none;
|
||||||
|
@@ -191,7 +191,7 @@ window.addEventListener('popstate', onHistoryChanged);
|
|||||||
window.history.pushState = patchHistoryMethod('pushState');
|
window.history.pushState = patchHistoryMethod('pushState');
|
||||||
window.history.replaceState = patchHistoryMethod('replaceState');
|
window.history.replaceState = patchHistoryMethod('replaceState');
|
||||||
|
|
||||||
BxEventBus.Script.once('xcloudServerUnavailable', () => {
|
BxEventBus.Script.once('xcloud.server.unavailable', () => {
|
||||||
STATES.supportedRegion = false;
|
STATES.supportedRegion = false;
|
||||||
window.setTimeout(HeaderSection.watchHeader, 2000);
|
window.setTimeout(HeaderSection.watchHeader, 2000);
|
||||||
|
|
||||||
|
@@ -8,6 +8,9 @@ import { SettingsDialog } from "./dialog/settings-dialog";
|
|||||||
import { TrueAchievements } from "@/utils/true-achievements";
|
import { TrueAchievements } from "@/utils/true-achievements";
|
||||||
import { BxIcon } from "@/utils/bx-icon";
|
import { BxIcon } from "@/utils/bx-icon";
|
||||||
import { BxEventBus } from "@/utils/bx-event-bus";
|
import { BxEventBus } from "@/utils/bx-event-bus";
|
||||||
|
import { getPref } from "@/utils/settings-storages/global-settings-storage";
|
||||||
|
import { UiLayout } from "@/enums/pref-values";
|
||||||
|
import { PrefKey } from "@/enums/pref-keys";
|
||||||
|
|
||||||
export enum GuideMenuTab {
|
export enum GuideMenuTab {
|
||||||
HOME = 'home',
|
HOME = 'home',
|
||||||
@@ -41,7 +44,7 @@ export class GuideMenu {
|
|||||||
style: ButtonStyle.FULL_WIDTH | ButtonStyle.FOCUSABLE | ButtonStyle.PRIMARY,
|
style: ButtonStyle.FULL_WIDTH | ButtonStyle.FOCUSABLE | ButtonStyle.PRIMARY,
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
// Wait until the Guide dialog is closed
|
// Wait until the Guide dialog is closed
|
||||||
BxEventBus.Script.once('xcloudDialogDismissed', () => {
|
BxEventBus.Script.once('dialog.dismissed', () => {
|
||||||
setTimeout(() => SettingsDialog.getInstance().show(), 50);
|
setTimeout(() => SettingsDialog.getInstance().show(), 50);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -111,6 +114,11 @@ export class GuideMenu {
|
|||||||
class: 'bx-guide-home-buttons',
|
class: 'bx-guide-home-buttons',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Set TV tag
|
||||||
|
if (STATES.userAgent.isTv || getPref<UiLayout>(PrefKey.UI_LAYOUT) === UiLayout.TV) {
|
||||||
|
document.body.dataset.bxMediaType = 'tv';
|
||||||
|
}
|
||||||
|
|
||||||
for (const $button of buttonsLayout) {
|
for (const $button of buttonsLayout) {
|
||||||
if (!$button) {
|
if (!$button) {
|
||||||
continue;
|
continue;
|
||||||
|
@@ -78,7 +78,7 @@ export class BxEventBus<TEvents extends Record<string, any>> {
|
|||||||
BX_FLAGS.Debug && BxLogger.warning('EventBus', 'on', event, callback);
|
BX_FLAGS.Debug && BxLogger.warning('EventBus', 'on', event, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
once<K extends keyof TEvents>(event: string, callback: EventCallback<TEvents[K]>): void {
|
once<K extends keyof TEvents>(event: K, callback: EventCallback<TEvents[K]>): void {
|
||||||
const wrapper = (...args: any[]) => {
|
const wrapper = (...args: any[]) => {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
callback(...args);
|
callback(...args);
|
||||||
|
Reference in New Issue
Block a user