mirror of
https://github.com/JulianGro/overte.git
synced 2025-08-12 13:34:51 +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,
|
var showLeft,
|
||||||
showRight;
|
showRight;
|
||||||
|
|
||||||
// Don't show mini tablet if tablet proper is already displayed or in toolbar mode.
|
// Don't show mini tablet if tablet proper is already displayed, in toolbar mode, or away.
|
||||||
if (HMD.showTablet || tablet.toolbarMode) {
|
if (HMD.showTablet || tablet.toolbarMode || MyAvatar.isAway) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1016,6 +1016,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onWentAway() {
|
||||||
|
// Mini tablet only available when user is not away.
|
||||||
|
miniState.setState(miniState.MINI_HIDDEN);
|
||||||
|
}
|
||||||
|
|
||||||
function onDisplayModeChanged() {
|
function onDisplayModeChanged() {
|
||||||
// Mini tablet only available when HMD is active.
|
// Mini tablet only available when HMD is active.
|
||||||
if (HMD.active) {
|
if (HMD.active) {
|
||||||
|
@ -1035,6 +1040,7 @@
|
||||||
Messages.subscribe(HIFI_OBJECT_MANIPULATION_CHANNEL);
|
Messages.subscribe(HIFI_OBJECT_MANIPULATION_CHANNEL);
|
||||||
Messages.messageReceived.connect(onMessageReceived);
|
Messages.messageReceived.connect(onMessageReceived);
|
||||||
|
|
||||||
|
MyAvatar.wentAway.connect(onWentAway);
|
||||||
HMD.displayModeChanged.connect(onDisplayModeChanged);
|
HMD.displayModeChanged.connect(onDisplayModeChanged);
|
||||||
if (HMD.active) {
|
if (HMD.active) {
|
||||||
miniState.setState(miniState.MINI_HIDDEN);
|
miniState.setState(miniState.MINI_HIDDEN);
|
||||||
|
@ -1045,6 +1051,7 @@
|
||||||
miniState.setState(miniState.MINI_DISABLED);
|
miniState.setState(miniState.MINI_DISABLED);
|
||||||
|
|
||||||
HMD.displayModeChanged.disconnect(onDisplayModeChanged);
|
HMD.displayModeChanged.disconnect(onDisplayModeChanged);
|
||||||
|
MyAvatar.wentAway.disconnect(onWentAway);
|
||||||
|
|
||||||
Messages.messageReceived.disconnect(onMessageReceived);
|
Messages.messageReceived.disconnect(onMessageReceived);
|
||||||
Messages.unsubscribe(HIFI_OBJECT_MANIPULATION_CHANNEL);
|
Messages.unsubscribe(HIFI_OBJECT_MANIPULATION_CHANNEL);
|
||||||
|
|
Loading…
Reference in a new issue