mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-04-06 02:01:58 +02:00
Add warning when SteamVR hand trackers are erroneously enabled
This commit is contained in:
@@ -1601,6 +1601,9 @@ tracking_checklist-FULL_RESET-desc = Some trackers need a reset to be performed.
|
||||
tracking_checklist-STEAMVR_DISCONNECTED = SteamVR not running
|
||||
tracking_checklist-STEAMVR_DISCONNECTED-desc = SteamVR is not running. Are you using it for VR?
|
||||
tracking_checklist-STEAMVR_DISCONNECTED-open = Launch SteamVR
|
||||
tracking_checklist-STEAMVR_HANDS_ENABLED = Hand trackers toggled on
|
||||
tracking_checklist-STEAMVR_HANDS_ENABLED-desc = You have enabled the SteamVR virtual hand trackers. This will cause button inputs to not work in SteamVR and in games.
|
||||
tracking_checklist-STEAMVR_HANDS_ENABLED-go = Disable them
|
||||
tracking_checklist-TRACKERS_REST_CALIBRATION = Calibrate your trackers
|
||||
tracking_checklist-TRACKERS_REST_CALIBRATION-desc = You didn't perform tracker calibration. Please let your trackers (highlighted in yellow) rest on a stable surface for a few secconds.
|
||||
tracking_checklist-TRACKER_ERROR = Trackers with Errors
|
||||
|
||||
@@ -6,7 +6,12 @@ import {
|
||||
} from '@/hooks/tracking-checklist';
|
||||
import classNames from 'classnames';
|
||||
import {
|
||||
ChangeSettingsRequestT,
|
||||
ResetType,
|
||||
RpcMessage,
|
||||
SettingsRequestT,
|
||||
SettingsResponseT,
|
||||
SteamVRTrackersSettingT,
|
||||
TrackingChecklistPublicNetworksT,
|
||||
TrackingChecklistStepId,
|
||||
} from 'solarxr-protocol';
|
||||
@@ -29,6 +34,7 @@ import { TrackingChecklistModal } from './TrackingChecklistModal';
|
||||
import { NavLink, useNavigate } from 'react-router-dom';
|
||||
import { useBreakpoint } from '@/hooks/breakpoint';
|
||||
import { openUrl } from '@/hooks/crossplatform';
|
||||
import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
|
||||
function Step({
|
||||
step: { status, id, optional, firstRequired },
|
||||
@@ -102,6 +108,55 @@ function Step({
|
||||
);
|
||||
}
|
||||
|
||||
function SteamVRHandsEnabled() {
|
||||
const { sendRPCPacket, useRPCPacket } = useWebsocketAPI();
|
||||
const [steamVrTrackers, setSteamVrTrackers] = useState<Omit<
|
||||
SteamVRTrackersSettingT,
|
||||
'pack'
|
||||
> | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
sendRPCPacket(RpcMessage.SettingsRequest, new SettingsRequestT());
|
||||
}, []);
|
||||
|
||||
useRPCPacket(RpcMessage.SettingsResponse, (settings: SettingsResponseT) => {
|
||||
if (settings.steamVrTrackers) {
|
||||
setSteamVrTrackers(settings.steamVrTrackers);
|
||||
}
|
||||
});
|
||||
|
||||
const disableHandTrackers = () => {
|
||||
const settings = new ChangeSettingsRequestT();
|
||||
settings.steamVrTrackers = new SteamVRTrackersSettingT(
|
||||
steamVrTrackers?.waist,
|
||||
steamVrTrackers?.chest,
|
||||
steamVrTrackers?.automaticTrackerToggle,
|
||||
steamVrTrackers?.leftFoot,
|
||||
steamVrTrackers?.rightFoot,
|
||||
steamVrTrackers?.leftKnee,
|
||||
steamVrTrackers?.rightKnee,
|
||||
steamVrTrackers?.leftElbow,
|
||||
steamVrTrackers?.rightElbow,
|
||||
false,
|
||||
false
|
||||
);
|
||||
sendRPCPacket(RpcMessage.ChangeSettingsRequest, settings);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="space-y-2.5">
|
||||
<Typography id="tracking_checklist-STEAMVR_HANDS_ENABLED-desc" />
|
||||
<div className="flex">
|
||||
<Button
|
||||
id="tracking_checklist-STEAMVR_HANDS_ENABLED-go"
|
||||
variant="primary"
|
||||
onClick={disableHandTrackers}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const stepContentLookup: Record<
|
||||
number,
|
||||
(
|
||||
@@ -352,6 +407,9 @@ const stepContentLookup: Record<
|
||||
</>
|
||||
);
|
||||
},
|
||||
[TrackingChecklistStepId.STEAMVR_HANDS_ENABLED]: () => {
|
||||
return <SteamVRHandsEnabled />;
|
||||
},
|
||||
};
|
||||
|
||||
export function TrackingChecklistMobile() {
|
||||
|
||||
@@ -30,6 +30,8 @@ export const trackingchecklistIdtoLabel: Record<TrackingChecklistStepId, string>
|
||||
'tracking_checklist-FEET_MOUNTING_CALIBRATION',
|
||||
[TrackingChecklistStepId.STAY_ALIGNED_CONFIGURED]:
|
||||
'tracking_checklist-STAY_ALIGNED_CONFIGURED',
|
||||
[TrackingChecklistStepId.STEAMVR_HANDS_ENABLED]:
|
||||
'tracking_checklist-STEAMVR_HANDS_ENABLED',
|
||||
};
|
||||
|
||||
export type TrackingChecklistStepStatus =
|
||||
|
||||
@@ -8,6 +8,8 @@ import dev.slimevr.games.vrchat.VRCConfigRecommendedValues
|
||||
import dev.slimevr.games.vrchat.VRCConfigValidity
|
||||
import dev.slimevr.games.vrchat.VRCConfigValues
|
||||
import dev.slimevr.tracking.trackers.Tracker
|
||||
import dev.slimevr.tracking.trackers.TrackerPosition
|
||||
import dev.slimevr.tracking.trackers.TrackerRole
|
||||
import dev.slimevr.tracking.trackers.TrackerStatus
|
||||
import dev.slimevr.tracking.trackers.TrackerUtils
|
||||
import dev.slimevr.tracking.trackers.udp.TrackerDataType
|
||||
@@ -86,6 +88,16 @@ class TrackingChecklistManager(private val vrServer: VRServer) : VRCConfigListen
|
||||
},
|
||||
)
|
||||
|
||||
steps.add(
|
||||
TrackingChecklistStepT().apply {
|
||||
id = TrackingChecklistStepId.STEAMVR_HANDS_ENABLED
|
||||
enabled = false
|
||||
optional = false
|
||||
ignorable = false
|
||||
visibility = TrackingChecklistStepVisibility.WHEN_INVALID
|
||||
},
|
||||
)
|
||||
|
||||
steps.add(
|
||||
TrackingChecklistStepT().apply {
|
||||
id = TrackingChecklistStepId.TRACKER_ERROR
|
||||
@@ -280,6 +292,17 @@ class TrackingChecklistManager(private val vrServer: VRServer) : VRCConfigListen
|
||||
it.extraData = null
|
||||
}
|
||||
}
|
||||
|
||||
val handsEnabled = steamVRBridge.getShareSetting(TrackerRole.LEFT_HAND) || steamVRBridge.getShareSetting(TrackerRole.RIGHT_HAND)
|
||||
val hasControllers = vrServer.allTrackers.any {
|
||||
(it.trackerPosition == TrackerPosition.LEFT_HAND || it.trackerPosition == TrackerPosition.RIGHT_HAND) && it.isComputed && !it.isInternal
|
||||
}
|
||||
val hasHandTrackers = vrServer.allTrackers.any {
|
||||
(it.trackerPosition == TrackerPosition.LEFT_HAND || it.trackerPosition == TrackerPosition.RIGHT_HAND) && !it.isComputed
|
||||
}
|
||||
updateValidity(TrackingChecklistStepId.STEAMVR_HANDS_ENABLED, !steamvrConnected || !handsEnabled || (!hasControllers && hasHandTrackers)) {
|
||||
it.enabled = true
|
||||
}
|
||||
}
|
||||
|
||||
if (vrServer.networkProfileChecker.isSupported) {
|
||||
|
||||
Submodule solarxr-protocol updated: fa2895b19a...f151687657
Reference in New Issue
Block a user