mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 15:47:18 +02:00
Update script in app when clicking on the "Version x available" button
This commit is contained in:
parent
714178a82d
commit
07ebf3926b
@ -1,5 +1,5 @@
|
|||||||
import { onChangeVideoPlayerType, updateVideoPlayer } from "@/modules/stream/stream-settings-utils";
|
import { onChangeVideoPlayerType, updateVideoPlayer } from "@/modules/stream/stream-settings-utils";
|
||||||
import { ButtonStyle, CE, createButton, createSvgIcon, removeChildElements } from "@/utils/html";
|
import { ButtonStyle, CE, createButton, createSvgIcon, removeChildElements, type BxButton } from "@/utils/html";
|
||||||
import { NavigationDialog, NavigationDirection } from "./navigation-dialog";
|
import { NavigationDialog, NavigationDirection } from "./navigation-dialog";
|
||||||
import { ControllerShortcut } from "@/modules/controller-shortcut";
|
import { ControllerShortcut } from "@/modules/controller-shortcut";
|
||||||
import { MkbRemapper } from "@/modules/mkb/mkb-remapper";
|
import { MkbRemapper } from "@/modules/mkb/mkb-remapper";
|
||||||
@ -97,12 +97,19 @@ export class SettingsNavigationDialog extends NavigationDialog {
|
|||||||
|
|
||||||
// "New version available" button
|
// "New version available" button
|
||||||
if (!SCRIPT_VERSION.includes('beta') && PREF_LATEST_VERSION && PREF_LATEST_VERSION != SCRIPT_VERSION) {
|
if (!SCRIPT_VERSION.includes('beta') && PREF_LATEST_VERSION && PREF_LATEST_VERSION != SCRIPT_VERSION) {
|
||||||
// Show new version indicator
|
// Show new version button
|
||||||
topButtons.push(createButton({
|
const opts = {
|
||||||
label: `🌟 Version ${PREF_LATEST_VERSION} available`,
|
label: '🌟 ' + t('new-version-available', {version: PREF_LATEST_VERSION}),
|
||||||
style: ButtonStyle.PRIMARY | ButtonStyle.FOCUSABLE | ButtonStyle.FULL_WIDTH,
|
style: ButtonStyle.PRIMARY | ButtonStyle.FOCUSABLE | ButtonStyle.FULL_WIDTH,
|
||||||
url: 'https://github.com/redphx/better-xcloud/releases/latest',
|
} as BxButton;
|
||||||
}));
|
|
||||||
|
if (AppInterface && AppInterface.updateLatestScript) {
|
||||||
|
opts.onClick = e => AppInterface.updateLatestScript();
|
||||||
|
} else {
|
||||||
|
opts.url = 'https://github.com/redphx/better-xcloud/releases/latest';
|
||||||
|
}
|
||||||
|
|
||||||
|
topButtons.push(createButton(opts));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Buttons for Android app
|
// Buttons for Android app
|
||||||
|
@ -32,7 +32,7 @@ const ButtonStyleClass = {
|
|||||||
[ButtonStyle.NORMAL_LINK]: 'bx-normal-link',
|
[ButtonStyle.NORMAL_LINK]: 'bx-normal-link',
|
||||||
}
|
}
|
||||||
|
|
||||||
type BxButton = {
|
export type BxButton = {
|
||||||
style?: ButtonStyle;
|
style?: ButtonStyle;
|
||||||
url?: string;
|
url?: string;
|
||||||
classes?: string[];
|
classes?: string[];
|
||||||
|
@ -584,7 +584,7 @@ export class GlobalSettingsStorage extends BaseSettingsStorage {
|
|||||||
default: 'default',
|
default: 'default',
|
||||||
options: {
|
options: {
|
||||||
'default': t('default'),
|
'default': t('default'),
|
||||||
'low-power': t('low-power'),
|
'low-power': t('battery-saving'),
|
||||||
'high-performance': t('high-performance'),
|
'high-performance': t('high-performance'),
|
||||||
},
|
},
|
||||||
suggest: {
|
suggest: {
|
||||||
|
@ -47,6 +47,7 @@ const Texts = {
|
|||||||
"badge-playtime": "Playtime",
|
"badge-playtime": "Playtime",
|
||||||
"badge-server": "Server",
|
"badge-server": "Server",
|
||||||
"badge-video": "Video",
|
"badge-video": "Video",
|
||||||
|
"battery-saving": "Battery saving",
|
||||||
"better-xcloud": "Better xCloud",
|
"better-xcloud": "Better xCloud",
|
||||||
"bitrate-audio-maximum": "Maximum audio bitrate",
|
"bitrate-audio-maximum": "Maximum audio bitrate",
|
||||||
"bitrate-video-maximum": "Maximum video bitrate",
|
"bitrate-video-maximum": "Maximum video bitrate",
|
||||||
@ -142,7 +143,6 @@ const Texts = {
|
|||||||
"load-failed-message": "Failed to run Better xCloud",
|
"load-failed-message": "Failed to run Better xCloud",
|
||||||
"loading-screen": "Loading screen",
|
"loading-screen": "Loading screen",
|
||||||
"local-co-op": "Local co-op",
|
"local-co-op": "Local co-op",
|
||||||
"low-power": "Low power",
|
|
||||||
"lowest-quality": "Lowest quality",
|
"lowest-quality": "Lowest quality",
|
||||||
"map-mouse-to": "Map mouse to",
|
"map-mouse-to": "Map mouse to",
|
||||||
"may-not-work-properly": "May not work properly!",
|
"may-not-work-properly": "May not work properly!",
|
||||||
@ -157,6 +157,27 @@ const Texts = {
|
|||||||
"name": "Name",
|
"name": "Name",
|
||||||
"native-mkb": "Native Mouse & Keyboard",
|
"native-mkb": "Native Mouse & Keyboard",
|
||||||
"new": "New",
|
"new": "New",
|
||||||
|
"new-version-available": [
|
||||||
|
(e: any) => `Version ${e.version} available`,
|
||||||
|
,
|
||||||
|
,
|
||||||
|
,
|
||||||
|
,
|
||||||
|
,
|
||||||
|
,
|
||||||
|
,
|
||||||
|
(e: any) => `Ver ${e.version} が利用可能です`,
|
||||||
|
(e: any) => `${e.version} 버전 사용가능`,
|
||||||
|
,
|
||||||
|
,
|
||||||
|
,
|
||||||
|
,
|
||||||
|
,
|
||||||
|
,
|
||||||
|
(e: any) => `Đã có phiên bản ${e.version}`,
|
||||||
|
,
|
||||||
|
,
|
||||||
|
],
|
||||||
"no-consoles-found": "No consoles found",
|
"no-consoles-found": "No consoles found",
|
||||||
"normal": "Normal",
|
"normal": "Normal",
|
||||||
"off": "Off",
|
"off": "Off",
|
||||||
@ -199,7 +220,7 @@ const Texts = {
|
|||||||
"recommended": "Recommended",
|
"recommended": "Recommended",
|
||||||
"recommended-settings-for-device": [
|
"recommended-settings-for-device": [
|
||||||
(e: any) => `Recommended settings for ${e.device}`,
|
(e: any) => `Recommended settings for ${e.device}`,
|
||||||
,
|
(e: any) => `Configuració recomanada per a ${e.device}`,
|
||||||
,
|
,
|
||||||
(e: any) => `Empfohlene Einstellungen für ${e.device}`,
|
(e: any) => `Empfohlene Einstellungen für ${e.device}`,
|
||||||
,
|
,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user