mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-20 00:51:20 -08:00
add standalone usage guide step
This commit is contained in:
9 files changed
+187
-3
No files matched your search
@@ -541,9 +541,11 @@ settings-osc-router-network-address-placeholder = IPV4 address
|
||||
## OSC VRChat settings
|
||||
settings-osc-vrchat = VRChat OSC Trackers
|
||||
# This cares about multilines
|
||||
settings-osc-vrchat-description-v1 =
|
||||
settings-osc-vrchat-description-v2 =
|
||||
Change settings specific to the OSC Trackers standard used for sending
|
||||
tracking data to applications without SteamVR (ex. Quest standalone).
|
||||
# This cares about multilines
|
||||
settings-osc-vrchat-description-guide =
|
||||
Make sure to enable OSC in VRChat via the Action Menu under OSC > Enabled.
|
||||
To allow receiving HMD and controller data from VRChat, go in your main menu's
|
||||
settings under Tracking & IK > Allow Sending Head and Wrist VR Tracking OSC Data.
|
||||
@@ -765,6 +767,9 @@ onboarding-usage-vr-choose-standalone = i use standalone
|
||||
onboarding-usage-vr-choose-standalone-label = for portable vr
|
||||
onboarding-usage-vr-choose-standalone-description = this happens if standalone
|
||||
|
||||
onboarding-usage-vr-standalone-title = Setting up VRChat
|
||||
onboarding-usage-vr-standalone-next = Done!
|
||||
|
||||
## Tracker assignment setup
|
||||
onboarding-assign_trackers-back = Go Back to Wi-Fi Credentials
|
||||
onboarding-assign_trackers-title = Assign trackers
|
||||
|
||||
Binary file not shown.
@@ -58,6 +58,7 @@ import { useDiscordPresence } from './hooks/discord-presence';
|
||||
import { AdvancedSettings } from './components/settings/pages/AdvancedSettings';
|
||||
import { UsageChoose } from './components/onboarding/pages/usage-reason/UsageChoose';
|
||||
import { VRUsageChoose } from './components/onboarding/pages/usage-reason/VRUsageChoose';
|
||||
import { StandaloneUsageSetup } from './components/onboarding/pages/usage-reason/StandaloneUsageSetup';
|
||||
|
||||
export const GH_REPO = 'SlimeVR/SlimeVR-Server';
|
||||
export const VersionContext = createContext('');
|
||||
@@ -136,6 +137,10 @@ function Layout() {
|
||||
/>
|
||||
<Route path="usage/choose" element={<UsageChoose />} />
|
||||
<Route path="usage/vr/choose" element={<VRUsageChoose />} />
|
||||
<Route
|
||||
path="usage/vr/standalone"
|
||||
element={<StandaloneUsageSetup />}
|
||||
/>
|
||||
<Route path="trackers-assign" element={<TrackersAssignPage />} />
|
||||
<Route path="enter-vr" element={<EnterVRPage />} />
|
||||
<Route path="mounting/choose" element={<MountingChoose />}></Route>
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
import { useRef, useState } from 'react';
|
||||
import { PlayCircleIcon } from './icon/PlayIcon';
|
||||
import { useDebouncedEffect } from '@/hooks/timeout';
|
||||
|
||||
export function PausableVideo({
|
||||
src,
|
||||
poster,
|
||||
}: {
|
||||
src?: string;
|
||||
poster?: string;
|
||||
}) {
|
||||
const videoRef = useRef<HTMLVideoElement | null>(null);
|
||||
const [paused, setPaused] = useState(true);
|
||||
|
||||
function toggleVideo() {
|
||||
if (!videoRef.current) return;
|
||||
if (videoRef.current.paused) {
|
||||
videoRef.current.play();
|
||||
} else {
|
||||
videoRef.current.pause();
|
||||
videoRef.current.currentTime = 0;
|
||||
}
|
||||
setPaused(videoRef.current.paused);
|
||||
}
|
||||
|
||||
useDebouncedEffect(
|
||||
() => {
|
||||
if (paused) videoRef.current?.pause();
|
||||
},
|
||||
[paused],
|
||||
250
|
||||
);
|
||||
|
||||
return (
|
||||
<button className="relative appearance-none h-fit" onClick={toggleVideo}>
|
||||
<div
|
||||
className="absolute w-[100px] h-[100px] top-0 bottom-0 left-0 right-0 m-auto fill-background-20"
|
||||
hidden={!paused}
|
||||
>
|
||||
<PlayCircleIcon width={100}></PlayCircleIcon>
|
||||
</div>
|
||||
|
||||
<video
|
||||
preload="auto"
|
||||
ref={videoRef}
|
||||
src={src}
|
||||
poster={poster}
|
||||
className="min-w-[12rem] w-[30rem]"
|
||||
muted
|
||||
loop
|
||||
playsInline
|
||||
controls={false}
|
||||
></video>
|
||||
</button>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
import { Button } from '@/components/commons/Button';
|
||||
import { PausableVideo } from '@/components/commons/PausableVideo';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { useOnboarding } from '@/hooks/onboarding';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import { VRCHAT_OSC_VIDEO } from '@/utils/tauri';
|
||||
import { useLocalization } from '@fluent/react';
|
||||
import classNames from 'classnames';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import {
|
||||
ChangeSettingsRequestT,
|
||||
OSCSettingsT,
|
||||
RpcMessage,
|
||||
SettingsRequestT,
|
||||
SettingsResponseT,
|
||||
VRCOSCSettingsT,
|
||||
} from 'solarxr-protocol';
|
||||
|
||||
export function StandaloneUsageSetup() {
|
||||
const { applyProgress, state } = useOnboarding();
|
||||
const { l10n } = useLocalization();
|
||||
const { sendRPCPacket, useRPCPacket } = useWebsocketAPI();
|
||||
const fetchedSettings = useRef<OSCSettingsT | null>(null);
|
||||
const navigate = useNavigate();
|
||||
|
||||
useEffect(() => {
|
||||
sendRPCPacket(RpcMessage.SettingsRequest, new SettingsRequestT());
|
||||
}, []);
|
||||
|
||||
const toggleVrc = (bool: boolean) => {
|
||||
const oldOscSettings = fetchedSettings.current;
|
||||
|
||||
const settings = new ChangeSettingsRequestT();
|
||||
const vrcOsc = new VRCOSCSettingsT();
|
||||
vrcOsc.oscSettings = new OSCSettingsT(
|
||||
bool,
|
||||
oldOscSettings?.portIn,
|
||||
oldOscSettings?.portOut,
|
||||
oldOscSettings?.address
|
||||
);
|
||||
|
||||
settings.vrcOsc = vrcOsc;
|
||||
sendRPCPacket(RpcMessage.ChangeSettingsRequest, settings);
|
||||
};
|
||||
|
||||
useRPCPacket(
|
||||
RpcMessage.SettingsResponse,
|
||||
(oldSettings: SettingsResponseT) => {
|
||||
fetchedSettings.current = oldSettings.vrcOsc?.oscSettings ?? null;
|
||||
|
||||
toggleVrc(true);
|
||||
}
|
||||
);
|
||||
|
||||
applyProgress(0.6);
|
||||
|
||||
return (
|
||||
<div className="flex items-center justify-center h-full w-full mobile:pt-10">
|
||||
<div className="flex mobile:flex-col items-center xs:justify-center gap-5">
|
||||
<div className="mb-auto">
|
||||
<Typography variant="main-title">
|
||||
{l10n.getString('onboarding-usage-vr-standalone-title')}
|
||||
</Typography>
|
||||
</div>
|
||||
<div
|
||||
className={classNames(
|
||||
'flex flex-col rounded-lg p-6 gap-5 w-10/12 max-w-[600px]',
|
||||
!state.alonePage && 'bg-background-70',
|
||||
state.alonePage && 'bg-background-60'
|
||||
)}
|
||||
>
|
||||
<div className="self-center">
|
||||
{l10n
|
||||
.getString('settings-osc-vrchat-description-guide')
|
||||
.split('\n')
|
||||
.map((line, i) => (
|
||||
<Typography color="secondary" key={i}>
|
||||
{line}
|
||||
</Typography>
|
||||
))}
|
||||
</div>
|
||||
<div className="self-center">
|
||||
<PausableVideo src={VRCHAT_OSC_VIDEO} />
|
||||
</div>
|
||||
<div className="flex">
|
||||
<Button
|
||||
variant={!state.alonePage ? 'secondary' : 'tertiary'}
|
||||
className="self-start mt-auto"
|
||||
onClick={() => {
|
||||
toggleVrc(false);
|
||||
navigate('/onboarding/usage/vr/choose', {
|
||||
state: { alonePage: state.alonePage },
|
||||
});
|
||||
}}
|
||||
>
|
||||
{l10n.getString('onboarding-previous_step')}
|
||||
</Button>
|
||||
<Button
|
||||
variant="primary"
|
||||
to=""
|
||||
className="ml-auto"
|
||||
state={{ alonePage: state.alonePage }}
|
||||
>
|
||||
{l10n.getString('onboarding-usage-vr-standalone-next')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -78,7 +78,7 @@ export function VRUsageChoose() {
|
||||
</div>
|
||||
<Button
|
||||
variant={!state.alonePage ? 'secondary' : 'tertiary'}
|
||||
to={'/onboarding/mounting/auto'}
|
||||
to={'/onboarding/usage/vr/standalone'}
|
||||
className="self-start mt-auto"
|
||||
state={{ alonePage: state.alonePage }}
|
||||
>
|
||||
|
||||
Whitespace-only changes.
@@ -131,8 +131,13 @@ export function VRCOSCSettings() {
|
||||
<div className="flex flex-col pt-2 pb-4">
|
||||
<>
|
||||
{l10n
|
||||
.getString('settings-osc-vrchat-description-v1')
|
||||
.getString('settings-osc-vrchat-description-v2')
|
||||
.split('\n')
|
||||
.concat(
|
||||
l10n
|
||||
.getString('settings-osc-vrchat-description-guide')
|
||||
.split('\n')
|
||||
)
|
||||
.map((line, i) => (
|
||||
<Typography color="secondary" key={i}>
|
||||
{line}
|
||||
|
||||
@@ -14,6 +14,7 @@ export async function fetchResourceUrl(url: string) {
|
||||
// FIXME: For some fucking reason, you can't top-level await on a react component file
|
||||
// on Chromium on developments builds specifically -Uriel
|
||||
export const AUTOBONE_VIDEO = await fetchResourceUrl('/videos/autobone.webm');
|
||||
export const VRCHAT_OSC_VIDEO = await fetchResourceUrl('/videos/vrchatosc.webm');
|
||||
|
||||
export const isTrayAvailable =
|
||||
isTauri() && (await invoke<boolean>('is_tray_available'));
|
||||
Reference in new issue
Block a user