mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 05:52:31 +02:00
Merge pull request #15061 from r3tk0n/away_bubble_protection
[MS#21495] Enable Bubble/Shield on Away
This commit is contained in:
commit
6346df54af
1 changed files with 12 additions and 2 deletions
|
@ -65,7 +65,7 @@ var eventMappingName = "io.highfidelity.away"; // goActive on hand controller bu
|
||||||
var eventMapping = Controller.newMapping(eventMappingName);
|
var eventMapping = Controller.newMapping(eventMappingName);
|
||||||
var avatarPosition = MyAvatar.position;
|
var avatarPosition = MyAvatar.position;
|
||||||
var wasHmdMounted = HMD.mounted;
|
var wasHmdMounted = HMD.mounted;
|
||||||
|
var previousBubbleState = Users.getIgnoreRadiusEnabled();
|
||||||
|
|
||||||
// some intervals we may create/delete
|
// some intervals we may create/delete
|
||||||
var avatarMovedInterval;
|
var avatarMovedInterval;
|
||||||
|
@ -166,7 +166,12 @@ function goAway(fromStartup) {
|
||||||
avatarMovedInterval = Script.setInterval(ifAvatarMovedGoActive, BASIC_TIMER_INTERVAL);
|
avatarMovedInterval = Script.setInterval(ifAvatarMovedGoActive, BASIC_TIMER_INTERVAL);
|
||||||
}, WAIT_FOR_MOVE_ON_STARTUP);
|
}, WAIT_FOR_MOVE_ON_STARTUP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
previousBubbleState = Users.getIgnoreRadiusEnabled();
|
||||||
|
if (!previousBubbleState) {
|
||||||
|
Users.toggleIgnoreRadius();
|
||||||
|
}
|
||||||
|
UserActivityLogger.bubbleToggled(Users.getIgnoreRadiusEnabled());
|
||||||
UserActivityLogger.toggledAway(true);
|
UserActivityLogger.toggledAway(true);
|
||||||
MyAvatar.isAway = true;
|
MyAvatar.isAway = true;
|
||||||
}
|
}
|
||||||
|
@ -179,6 +184,11 @@ function goActive() {
|
||||||
UserActivityLogger.toggledAway(false);
|
UserActivityLogger.toggledAway(false);
|
||||||
MyAvatar.isAway = false;
|
MyAvatar.isAway = false;
|
||||||
|
|
||||||
|
if (Users.getIgnoreRadiusEnabled() !== previousBubbleState) {
|
||||||
|
Users.toggleIgnoreRadius();
|
||||||
|
UserActivityLogger.bubbleToggled(Users.getIgnoreRadiusEnabled());
|
||||||
|
}
|
||||||
|
|
||||||
if (!Window.hasFocus()) {
|
if (!Window.hasFocus()) {
|
||||||
Window.setFocus();
|
Window.setFocus();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue