make away show overlays if they are hidden when you enter away

This commit is contained in:
Brad Hefta-Gaub 2016-03-11 11:45:52 -08:00
parent 18f5b14e7a
commit d32611a7f9

View file

@ -152,6 +152,7 @@ function maybeMoveOverlay() {
// MAIN CONTROL
var wasMuted, isAway;
var wasOverlaysVisible = Menu.isOptionChecked("Overlays");
var eventMappingName = "io.highfidelity.away"; // goActive on hand controller button events, too.
var eventMapping = Controller.newMapping(eventMappingName);
@ -169,6 +170,13 @@ function goAway() {
playAwayAnimation(); // animation is still seen by others
showOverlay();
// remember the View > Overlays state...
wasOverlaysVisible = Menu.isOptionChecked("Overlays");
print("wasOverlaysVisible:" + wasOverlaysVisible);
// show overlays so that people can see the "Away" message
Menu.setIsOptionChecked("Overlays", true);
// tell the Reticle, we want to stop capturing the mouse until we come back
Reticle.allowMouseCapture = false;
if (HMD.active) {
@ -188,6 +196,9 @@ function goActive() {
stopAwayAnimation();
hideOverlay();
// restore overlays state to what it was when we went "away"
Menu.setIsOptionChecked("Overlays", wasOverlaysVisible);
// tell the Reticle, we are ready to capture the mouse again and it should be visible
Reticle.allowMouseCapture = true;
Reticle.visible = true;