mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-22 07:23:03 +02:00
Add "Prefer IPv6 server" option for Remote Play
This commit is contained in:
parent
80f47a93d4
commit
c76a3cc7a4
11
dist/better-xcloud.pretty.user.js
vendored
11
dist/better-xcloud.pretty.user.js
vendored
File diff suppressed because one or more lines are too long
10
dist/better-xcloud.user.js
vendored
10
dist/better-xcloud.user.js
vendored
File diff suppressed because one or more lines are too long
@ -2,22 +2,29 @@
|
||||
margin-bottom: 12px;
|
||||
padding-bottom: 12px;
|
||||
border-bottom: 1px solid #2d2d2d;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
|
||||
> div {
|
||||
display: flex;
|
||||
}
|
||||
min-height: 30px;
|
||||
|
||||
label {
|
||||
flex: 1;
|
||||
font-size: 14px;
|
||||
> label {
|
||||
flex: 1;
|
||||
font-size: 14px;
|
||||
align-self: center;
|
||||
|
||||
p {
|
||||
margin: 4px 0 0;
|
||||
padding: 0;
|
||||
color: #888;
|
||||
font-size: 12px;
|
||||
p {
|
||||
margin: 4px 0 0;
|
||||
padding: 0;
|
||||
color: #888;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.bx-remote-play-resolution {
|
||||
|
@ -80,6 +80,7 @@ export const enum GlobalPref {
|
||||
AUDIO_VOLUME_CONTROL_ENABLED = 'audio.volume.booster.enabled',
|
||||
|
||||
REMOTE_PLAY_STREAM_RESOLUTION = 'xhome.video.resolution',
|
||||
REMOTE_PLAY_PREFER_IPV6 = 'xhome.ipv6.prefer',
|
||||
|
||||
GAME_FORTNITE_FORCE_CONSOLE = 'game.fortnite.forceConsole',
|
||||
}
|
||||
@ -99,6 +100,7 @@ export type GlobalPrefTypeMap = {
|
||||
[GlobalPref.NATIVE_MKB_FORCED_GAMES]: string[];
|
||||
[GlobalPref.NATIVE_MKB_MODE]: NativeMkbMode;
|
||||
[GlobalPref.REMOTE_PLAY_STREAM_RESOLUTION]: StreamResolution;
|
||||
[GlobalPref.REMOTE_PLAY_PREFER_IPV6]: boolean;
|
||||
[GlobalPref.SCREENSHOT_APPLY_FILTERS]: boolean;
|
||||
[GlobalPref.SERVER_BYPASS_RESTRICTION]: string;
|
||||
[GlobalPref.SERVER_PREFER_IPV6]: boolean;
|
||||
@ -233,6 +235,7 @@ export const ALL_PREFS: {
|
||||
GlobalPref.NATIVE_MKB_FORCED_GAMES,
|
||||
GlobalPref.NATIVE_MKB_MODE,
|
||||
GlobalPref.REMOTE_PLAY_STREAM_RESOLUTION,
|
||||
GlobalPref.REMOTE_PLAY_PREFER_IPV6,
|
||||
GlobalPref.SCREENSHOT_APPLY_FILTERS,
|
||||
GlobalPref.SERVER_BYPASS_RESTRICTION,
|
||||
GlobalPref.SERVER_PREFER_IPV6,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ButtonStyle, CE, createButton } from "@/utils/html";
|
||||
import { ButtonStyle, CE, createButton, escapeCssSelector } from "@/utils/html";
|
||||
import { NavigationDialog, type NavigationElement } from "./navigation-dialog";
|
||||
import { GlobalPref } from "@/enums/pref-keys";
|
||||
import { BxIcon } from "@/utils/bx-icon";
|
||||
@ -11,6 +11,7 @@ import { BxLogger } from "@/utils/bx-logger";
|
||||
import { StreamResolution } from "@/enums/pref-values";
|
||||
import { setNearby } from "@/utils/navigation-utils";
|
||||
import { AppInterface } from "@/utils/global";
|
||||
import { SettingElement } from "@/utils/setting-element";
|
||||
|
||||
|
||||
export class RemotePlayDialog extends NavigationDialog {
|
||||
@ -67,6 +68,9 @@ export class RemotePlayDialog extends NavigationDialog {
|
||||
}, CE('div', false,
|
||||
CE('label', false, t('target-resolution'), $settingNote),
|
||||
$resolutions,
|
||||
), CE('div', false,
|
||||
CE('label', { 'for': `bx_setting_${escapeCssSelector(GlobalPref.REMOTE_PLAY_PREFER_IPV6)}` }, t('prefer-ipv6-server')),
|
||||
SettingElement.fromPref(GlobalPref.REMOTE_PLAY_PREFER_IPV6),
|
||||
));
|
||||
|
||||
$fragment.appendChild($qualitySettings);
|
||||
|
@ -109,7 +109,7 @@ export async function patchIceCandidates(request: Request, consoleAddrs?: Remote
|
||||
}
|
||||
|
||||
const options = {
|
||||
preferIpv6Server: getGlobalPref(GlobalPref.SERVER_PREFER_IPV6),
|
||||
preferIpv6Server: getGlobalPref(consoleAddrs ? GlobalPref.REMOTE_PLAY_PREFER_IPV6 : GlobalPref.SERVER_PREFER_IPV6),
|
||||
consoleAddrs: consoleAddrs,
|
||||
};
|
||||
|
||||
|
@ -535,6 +535,11 @@ export class GlobalSettingsStorage extends BaseSettingsStorage<GlobalPref> {
|
||||
},
|
||||
},
|
||||
|
||||
[GlobalPref.REMOTE_PLAY_PREFER_IPV6]: {
|
||||
requiredVariants: 'full',
|
||||
default: false,
|
||||
},
|
||||
|
||||
[GlobalPref.GAME_FORTNITE_FORCE_CONSOLE]: {
|
||||
requiredVariants: 'full',
|
||||
label: '🎮 ' + t('fortnite-force-console-version'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user