From a274e5c2b1652254012cbc421b7c520bc0551b69 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Fri, 16 Aug 2019 12:31:50 -0700 Subject: [PATCH] Fix BUGZ-1263 and probably BUGZ-1273: Fix input device muted banner --- scripts/simplifiedUI/ui/simplifiedUI.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/scripts/simplifiedUI/ui/simplifiedUI.js b/scripts/simplifiedUI/ui/simplifiedUI.js index 46e10847f9..fb7f2824d6 100644 --- a/scripts/simplifiedUI/ui/simplifiedUI.js +++ b/scripts/simplifiedUI/ui/simplifiedUI.js @@ -483,7 +483,16 @@ function updateInputDeviceMutedOverlay(isMuted) { function onDesktopInputDeviceMutedChanged(isMuted) { - updateInputDeviceMutedOverlay(isMuted); + if (!HMD.active) { + updateInputDeviceMutedOverlay(isMuted); + } +} + + +function onHMDInputDeviceMutedChanged(isMuted) { + if (HMD.active) { + updateInputDeviceMutedOverlay(isMuted); + } } @@ -508,6 +517,12 @@ function onDisplayModeChanged(isHMDMode) { if (isHMDMode) { Camera.setModeString("first person"); } + + if (isHMDMode) { + onHMDInputDeviceMutedChanged(Audio.mutedHMD); + } else { + onDesktopInputDeviceMutedChanged(Audio.mutedDesktop); + } } function onToolbarVisibleChanged(isVisible, toolbarName) { @@ -578,6 +593,7 @@ function startup() { updateInputDeviceMutedOverlay(Audio.muted); updateOutputDeviceMutedOverlay(isOutputMuted()); Audio.mutedDesktopChanged.connect(onDesktopInputDeviceMutedChanged); + Audio.mutedHMDChanged.connect(onHMDInputDeviceMutedChanged); Window.geometryChanged.connect(onGeometryChanged); HMD.displayModeChanged.connect(onDisplayModeChanged); Audio.avatarGainChanged.connect(maybeUpdateOutputDeviceMutedOverlay); @@ -634,6 +650,7 @@ function shutdown() { si.unload(); Audio.mutedDesktopChanged.disconnect(onDesktopInputDeviceMutedChanged); + Audio.mutedHMDChanged.disconnect(onHMDInputDeviceMutedChanged); Window.geometryChanged.disconnect(onGeometryChanged); HMD.displayModeChanged.disconnect(onDisplayModeChanged); Audio.avatarGainChanged.disconnect(maybeUpdateOutputDeviceMutedOverlay);