mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-11 00:25:20 +02:00
Don't display mini tablet if user is away
This commit is contained in:
parent
80aa74600f
commit
45281960af
1 changed files with 9 additions and 2 deletions
|
@ -672,8 +672,8 @@
|
|||
var showLeft,
|
||||
showRight;
|
||||
|
||||
// Don't show mini tablet if tablet proper is already displayed or in toolbar mode.
|
||||
if (HMD.showTablet || tablet.toolbarMode) {
|
||||
// Don't show mini tablet if tablet proper is already displayed, in toolbar mode, or away.
|
||||
if (HMD.showTablet || tablet.toolbarMode || MyAvatar.isAway) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1016,6 +1016,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
function onWentAway() {
|
||||
// Mini tablet only available when user is not away.
|
||||
miniState.setState(miniState.MINI_HIDDEN);
|
||||
}
|
||||
|
||||
function onDisplayModeChanged() {
|
||||
// Mini tablet only available when HMD is active.
|
||||
if (HMD.active) {
|
||||
|
@ -1035,6 +1040,7 @@
|
|||
Messages.subscribe(HIFI_OBJECT_MANIPULATION_CHANNEL);
|
||||
Messages.messageReceived.connect(onMessageReceived);
|
||||
|
||||
MyAvatar.wentAway.connect(onWentAway);
|
||||
HMD.displayModeChanged.connect(onDisplayModeChanged);
|
||||
if (HMD.active) {
|
||||
miniState.setState(miniState.MINI_HIDDEN);
|
||||
|
@ -1045,6 +1051,7 @@
|
|||
miniState.setState(miniState.MINI_DISABLED);
|
||||
|
||||
HMD.displayModeChanged.disconnect(onDisplayModeChanged);
|
||||
MyAvatar.wentAway.disconnect(onWentAway);
|
||||
|
||||
Messages.messageReceived.disconnect(onMessageReceived);
|
||||
Messages.unsubscribe(HIFI_OBJECT_MANIPULATION_CHANNEL);
|
||||
|
|
Loading…
Reference in a new issue