From 1476251dcb359f335084e4413f6f4c1634085a7f Mon Sep 17 00:00:00 2001 From: r3tk0n Date: Thu, 28 Feb 2019 15:21:24 -0800 Subject: [PATCH] Enable bubble on AFK, respect user setting upon return from AFK. --- scripts/system/away.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/system/away.js b/scripts/system/away.js index 45b6f43b73..3deb2249be 100644 --- a/scripts/system/away.js +++ b/scripts/system/away.js @@ -65,7 +65,7 @@ var eventMappingName = "io.highfidelity.away"; // goActive on hand controller bu var eventMapping = Controller.newMapping(eventMappingName); var avatarPosition = MyAvatar.position; var wasHmdMounted = HMD.mounted; - +var previousBubbleState = Users.getIgnoreRadiusEnabled(); // some intervals we may create/delete var avatarMovedInterval; @@ -166,7 +166,12 @@ function goAway(fromStartup) { avatarMovedInterval = Script.setInterval(ifAvatarMovedGoActive, BASIC_TIMER_INTERVAL); }, WAIT_FOR_MOVE_ON_STARTUP); } - + + previousBubbleState = Users.getIgnoreRadiusEnabled(); + if (!previousBubbleState) { + Users.toggleIgnoreRadius(); + } + UserActivityLogger.bubbleToggled(Users.getIgnoreRadiusEnabled()); UserActivityLogger.toggledAway(true); MyAvatar.isAway = true; } @@ -179,6 +184,11 @@ function goActive() { UserActivityLogger.toggledAway(false); MyAvatar.isAway = false; + if (Users.getIgnoreRadiusEnabled() !== previousBubbleState) { + Users.toggleIgnoreRadius(); + UserActivityLogger.bubbleToggled(Users.getIgnoreRadiusEnabled()); + } + if (!Window.hasFocus()) { Window.setFocus(); }