mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-26 20:06:28 -08:00
Fix automatic tracker toggle not cancelling on manual
This commit is contained in:
1 parent
1721943d20
commit
dd70977b6f
1 file changed
+3
-2
@@ -5,6 +5,7 @@ import dev.slimevr.device.DeviceOrigin
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.flow.combine
|
||||
import kotlinx.coroutines.flow.distinctUntilChanged
|
||||
import kotlinx.coroutines.flow.emptyFlow
|
||||
import kotlinx.coroutines.flow.filter
|
||||
import kotlinx.coroutines.flow.flatMapLatest
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
@@ -28,7 +29,6 @@ class OutputTrackerToggleBasicBehaviour : OutputTrackerToggleBehaviour {
|
||||
BodyPart.RIGHT_FOOT to setOf(BodyPart.RIGHT_FOOT, BodyPart.RIGHT_LOWER_LEG, BodyPart.RIGHT_UPPER_LEG),
|
||||
)
|
||||
|
||||
// TODO filter out DeviceOrigin.STEAMVR
|
||||
fun determineAutomaticOutputTrackers(
|
||||
config: OutputTrackersConfig,
|
||||
fineBodyParts: Set<BodyPart?>,
|
||||
@@ -54,8 +54,9 @@ class OutputTrackerToggleBasicBehaviour : OutputTrackerToggleBehaviour {
|
||||
receiver.context.dispatch(OutputTrackerToggleActions.SetOutputTrackers(config.trackers))
|
||||
}
|
||||
}
|
||||
.filter { it.automaticTrackerToggle } // Automatic
|
||||
.flatMapLatest { config ->
|
||||
if (!config.automaticTrackerToggle) return@flatMapLatest emptyFlow()
|
||||
|
||||
receiver.server.context.state
|
||||
.map { it.trackers.values }
|
||||
.flatMapLatest { trackers ->
|
||||
|
||||
Reference in new issue
Block a user