adding mute overlay back into HMD and have warn when muted disable in desktop

This commit is contained in:
Wayne Chen 2019-03-29 10:32:13 -07:00
parent 3241d2f960
commit 248f9ba375
3 changed files with 7 additions and 19 deletions

View file

@ -18,6 +18,7 @@ import TabletScriptingInterface 1.0
Rectangle {
id: micBar;
readonly property var level: AudioScriptingInterface.inputLevel;
readonly property var warnWhenMuted: AudioScriptingInterface.warnWhenMuted;
readonly property var clipping: AudioScriptingInterface.clipping;
property var muted: AudioScriptingInterface.muted;
property var pushToTalk: AudioScriptingInterface.pushToTalk;
@ -54,7 +55,7 @@ Rectangle {
opacity: 0.7;
onLevelChanged: {
var rectOpacity = muted && (level >= userSpeakingLevel) ? 1.0 : 0.7;
var rectOpacity = (muted && (level >= userSpeakingLevel)) && warnWhenMuted ? 1.0 : 0.7;
if (pushToTalk && !pushingToTalk) {
rectOpacity = (level >= userSpeakingLevel) ? 1.0 : 0.7;
} else if (mouseArea.containsMouse && rectOpacity != 1.0) {
@ -163,7 +164,7 @@ Rectangle {
Item {
id: status;
visible: pushToTalk || (muted && (level >= userSpeakingLevel));
visible: pushToTalk || (muted && (level >= userSpeakingLevel) && warnWhenMuted);
anchors {
left: parent.left;
@ -187,7 +188,7 @@ Rectangle {
verticalCenter: parent.verticalCenter;
}
color: pushToTalk ? (pushingToTalk ? colors.unmutedColor : colors.mutedColor) : (level >= userSpeakingLevel && muted) ? colors.mutedColor : colors.unmutedColor;
color: pushToTalk ? (pushingToTalk ? colors.unmutedColor : colors.mutedColor) : (level >= userSpeakingLevel && muted && warnWhenMuted) ? colors.mutedColor : colors.unmutedColor;
font.bold: true
text: pushToTalk ? (HMD.active ? "PTT" : "PTT-(T)") : (muted ? "MUTED" : "MUTE");

View file

@ -32,7 +32,8 @@ var DEFAULT_SCRIPTS_COMBINED = [
"system/firstPersonHMD.js",
"system/tablet-ui/tabletUI.js",
"system/emote.js",
"system/miniTablet.js"
"system/miniTablet.js",
"system/audioMuteOverlay.js"
];
var DEFAULT_SCRIPTS_SEPARATE = [
"system/controllers/controllerScripts.js",

View file

@ -58,20 +58,6 @@
parentID: MyAvatar.SELF_ID,
parentJointIndex: MyAvatar.getJointIndex("_CAMERA_MATRIX")
});
} else {
var textDimensions = { x: 100, y: 50 };
warningOverlayID = Overlays.addOverlay("text", {
name: "Muted-Warning",
font: { size: 36 },
text: warningText,
x: (Window.innerWidth - textDimensions.x) / 2,
y: (Window.innerHeight - textDimensions.y),
width: textDimensions.x,
height: textDimensions.y,
textColor: { red: 226, green: 51, blue: 77 },
backgroundAlpha: 0,
visible: true
});
}
}
@ -141,4 +127,4 @@
Audio.mutedChanged.connect(startOrStopPoll);
Audio.warnWhenMutedChanged.connect(startOrStopPoll);
}()); // END LOCAL_SCOPE
}()); // END LOCAL_SCOPE