mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 16:41:02 +02:00
Merge pull request #15482 from amantley/bugAwayAudioToggle
Fixed: turning on your microphone will now take you out of Away mode
This commit is contained in:
commit
4821e745cc
1 changed files with 13 additions and 5 deletions
|
@ -203,7 +203,7 @@ function setAwayProperties() {
|
||||||
if (!wasMuted) {
|
if (!wasMuted) {
|
||||||
Audio.muted = !Audio.muted;
|
Audio.muted = !Audio.muted;
|
||||||
}
|
}
|
||||||
MyAvatar.setEnableMeshVisible(false); // just for our own display, without changing point of view
|
MyAvatar.setEnableMeshVisible(false); // just for our own display, without changing point of view
|
||||||
playAwayAnimation(); // animation is still seen by others
|
playAwayAnimation(); // animation is still seen by others
|
||||||
showOverlay();
|
showOverlay();
|
||||||
|
|
||||||
|
@ -223,8 +223,8 @@ function setAwayProperties() {
|
||||||
|
|
||||||
function setActiveProperties() {
|
function setActiveProperties() {
|
||||||
isAway = false;
|
isAway = false;
|
||||||
if (!wasMuted) {
|
if (Audio.muted && !wasMuted) {
|
||||||
Audio.muted = !Audio.muted;
|
Audio.muted = false;
|
||||||
}
|
}
|
||||||
MyAvatar.setEnableMeshVisible(true); // IWBNI we respected Developer->Avatar->Draw Mesh setting.
|
MyAvatar.setEnableMeshVisible(true); // IWBNI we respected Developer->Avatar->Draw Mesh setting.
|
||||||
stopAwayAnimation();
|
stopAwayAnimation();
|
||||||
|
@ -254,7 +254,7 @@ function setActiveProperties() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function maybeGoActive(event) {
|
function maybeGoActive(event) {
|
||||||
if (event.isAutoRepeat) { // isAutoRepeat is true when held down (or when Windows feels like it)
|
if (event.isAutoRepeat) { // isAutoRepeat is true when held down (or when Windows feels like it)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!isAway && (event.text === 'ESC')) {
|
if (!isAway && (event.text === 'ESC')) {
|
||||||
|
@ -314,6 +314,13 @@ function setEnabled(value) {
|
||||||
isEnabled = value;
|
isEnabled = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkAudioToggled() {
|
||||||
|
if (isAway && !Audio.muted) {
|
||||||
|
goActive();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var CHANNEL_AWAY_ENABLE = "Hifi-Away-Enable";
|
var CHANNEL_AWAY_ENABLE = "Hifi-Away-Enable";
|
||||||
var handleMessage = function(channel, message, sender) {
|
var handleMessage = function(channel, message, sender) {
|
||||||
if (channel === CHANNEL_AWAY_ENABLE && sender === MyAvatar.sessionUUID) {
|
if (channel === CHANNEL_AWAY_ENABLE && sender === MyAvatar.sessionUUID) {
|
||||||
|
@ -324,9 +331,10 @@ var handleMessage = function(channel, message, sender) {
|
||||||
Messages.subscribe(CHANNEL_AWAY_ENABLE);
|
Messages.subscribe(CHANNEL_AWAY_ENABLE);
|
||||||
Messages.messageReceived.connect(handleMessage);
|
Messages.messageReceived.connect(handleMessage);
|
||||||
|
|
||||||
var maybeIntervalTimer = Script.setInterval(function(){
|
var maybeIntervalTimer = Script.setInterval(function() {
|
||||||
maybeMoveOverlay();
|
maybeMoveOverlay();
|
||||||
maybeGoAway();
|
maybeGoAway();
|
||||||
|
checkAudioToggled();
|
||||||
}, BASIC_TIMER_INTERVAL);
|
}, BASIC_TIMER_INTERVAL);
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue