@@ -15,6 +15,7 @@ import {
1515 SteamVRTrackersSettingT ,
1616 TapDetectionSettingsT ,
1717 HIDSettingsT ,
18+ VelocitySettingsT ,
1819} from 'solarxr-protocol' ;
1920import { useConfig } from '@/hooks/config' ;
2021import { useWebsocketAPI } from '@/hooks/websocket-api' ;
@@ -105,6 +106,9 @@ export type SettingsForm = {
105106 hidSettings : {
106107 trackersOverHID : boolean ;
107108 } ;
109+ velocitySettings : {
110+ sendDerivedVelocity : boolean ;
111+ } ;
108112} ;
109113
110114const defaultValues : SettingsForm = {
@@ -161,6 +165,7 @@ const defaultValues: SettingsForm = {
161165 resetsSettings : defaultResetSettings ,
162166 stayAligned : defaultStayAlignedSettings ,
163167 hidSettings : { trackersOverHID : false } ,
168+ velocitySettings : { sendDerivedVelocity : false } ,
164169} ;
165170
166171export function GeneralSettings ( ) {
@@ -286,6 +291,11 @@ export function GeneralSettings() {
286291 hidSettings . trackersOverHid = values . hidSettings . trackersOverHID ;
287292 settings . hidSettings = hidSettings ;
288293
294+ const velocitySettings = new VelocitySettingsT ( ) ;
295+ velocitySettings . sendDerivedVelocity =
296+ values . velocitySettings . sendDerivedVelocity ;
297+ settings . velocitySettings = velocitySettings ;
298+
289299 if ( values . resetsSettings ) {
290300 settings . resetsSettings = loadResetSettings ( values . resetsSettings ) ;
291301 }
@@ -407,6 +417,12 @@ export function GeneralSettings() {
407417 } ;
408418 }
409419
420+ if ( settings . velocitySettings ) {
421+ formData . velocitySettings = {
422+ sendDerivedVelocity : settings . velocitySettings . sendDerivedVelocity ,
423+ } ;
424+ }
425+
410426 reset ( { ...getValues ( ) , ...formData } ) ;
411427 } ) ;
412428
@@ -994,6 +1010,32 @@ export function GeneralSettings() {
9941010 />
9951011 </ div >
9961012
1013+ < div className = "flex flex-col pt-2 pb-1" >
1014+ < Typography variant = "section-title" >
1015+ { l10n . getString (
1016+ 'settings-general-fk_settings-velocity_settings'
1017+ ) }
1018+ </ Typography >
1019+ < div className = "pt-2" >
1020+ < Typography >
1021+ { l10n . getString (
1022+ 'settings-general-fk_settings-velocity_settings-description'
1023+ ) }
1024+ </ Typography >
1025+ </ div >
1026+ </ div >
1027+ < div className = "grid sm:grid-cols-1 pb-3" >
1028+ < CheckBox
1029+ variant = "toggle"
1030+ outlined
1031+ control = { control }
1032+ name = "velocitySettings.sendDerivedVelocity"
1033+ label = { l10n . getString (
1034+ 'settings-general-fk_settings-velocity_settings-send_derived_velocity'
1035+ ) }
1036+ />
1037+ </ div >
1038+
9971039 { config ?. debug && (
9981040 < >
9991041 < div className = "flex flex-col pt-2 pb-3" >
0 commit comments