mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-12-06 08:42:32 -08:00
Fix tap reset enable toggle not working
This commit is contained in:
2 files changed
+6
-6
No files matched your search
@@ -44,17 +44,17 @@ class TapDetectionBasicBehaviour : TapDetectionBehaviour {
|
||||
// setupMode uses defaults
|
||||
if (!tapDetectionState.setupMode) {
|
||||
when (trackerState.bodyPart) {
|
||||
tapDetectionState.yawResetBodyPart -> {
|
||||
tapDetectionState.yawResetBodyPart if tapDetectionConfig.yawResetEnabled -> {
|
||||
trackerTapDetectionState.performsReset = true
|
||||
trackerTapDetectionState.tapsNeeded = tapDetectionConfig.yawResetTaps
|
||||
}
|
||||
|
||||
tapDetectionState.fullResetBodyPart -> {
|
||||
tapDetectionState.fullResetBodyPart if tapDetectionConfig.fullResetEnabled -> {
|
||||
trackerTapDetectionState.performsReset = true
|
||||
trackerTapDetectionState.tapsNeeded = tapDetectionConfig.fullResetTaps
|
||||
}
|
||||
|
||||
tapDetectionState.mountingResetBodyPart -> {
|
||||
tapDetectionState.mountingResetBodyPart if tapDetectionConfig.mountingResetEnabled -> {
|
||||
trackerTapDetectionState.performsReset = true
|
||||
trackerTapDetectionState.tapsNeeded = tapDetectionConfig.mountingResetTaps
|
||||
}
|
||||
|
||||
@@ -48,9 +48,9 @@ class TapDetectionManager(val context: TapDetectionContext, val server: VRServer
|
||||
val bodyPart = tracker.context.state.value.bodyPart ?: return
|
||||
val tapDetectionConfig = settings.context.state.value.data.tapDetectionConfig
|
||||
val (resetType, actionDelay) = when (bodyPart) {
|
||||
state.yawResetBodyPart -> ResetType.YAW to tapDetectionConfig.yawResetDelay
|
||||
state.fullResetBodyPart -> ResetType.FULL to tapDetectionConfig.fullResetDelay
|
||||
state.mountingResetBodyPart -> ResetType.MOUNTING to tapDetectionConfig.mountingResetDelay
|
||||
state.yawResetBodyPart if tapDetectionConfig.yawResetEnabled -> ResetType.YAW to tapDetectionConfig.yawResetDelay
|
||||
state.fullResetBodyPart if tapDetectionConfig.fullResetEnabled -> ResetType.FULL to tapDetectionConfig.fullResetDelay
|
||||
state.mountingResetBodyPart if tapDetectionConfig.mountingResetEnabled -> ResetType.MOUNTING to tapDetectionConfig.mountingResetDelay
|
||||
else -> return
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user