mirror of
https://github.com/overte-org/overte.git
synced 2025-08-11 08:53:07 +02:00
Close the app when the user changes avatars
This commit is contained in:
parent
2cd6f7fd54
commit
310750fc0f
1 changed files with 20 additions and 4 deletions
|
@ -1614,6 +1614,17 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onSkeletonChanged() {
|
||||||
|
if (isAppActive) {
|
||||||
|
// Close the app because the new avatar may have different joint numbers meaning that the UI would be attached
|
||||||
|
// incorrectly. Let the user reopen the app because it can take some time for the new avatar to load.
|
||||||
|
isAppActive = false;
|
||||||
|
updateHandControllerGrab();
|
||||||
|
button.editProperties({ isActive: false });
|
||||||
|
stopApp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function setUp() {
|
function setUp() {
|
||||||
updateHandControllerGrab();
|
updateHandControllerGrab();
|
||||||
|
@ -1653,8 +1664,9 @@
|
||||||
// Grouping object.
|
// Grouping object.
|
||||||
grouping = new Grouping();
|
grouping = new Grouping();
|
||||||
|
|
||||||
// Settings changes.
|
// Changes.
|
||||||
MyAvatar.dominantHandChanged.connect(onDominantHandChanged);
|
MyAvatar.dominantHandChanged.connect(onDominantHandChanged);
|
||||||
|
MyAvatar.skeletonChanged.connect(onSkeletonChanged);
|
||||||
|
|
||||||
// Start main update loop.
|
// Start main update loop.
|
||||||
if (isAppActive) {
|
if (isAppActive) {
|
||||||
|
@ -1663,16 +1675,20 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function tearDown() {
|
function tearDown() {
|
||||||
|
if (!tablet) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (updateTimer) {
|
if (updateTimer) {
|
||||||
Script.clearTimeout(updateTimer);
|
Script.clearTimeout(updateTimer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MyAvatar.dominantHandChanged.disconnect(onDominantHandChanged);
|
||||||
|
MyAvatar.skeletonChanged.disconnect(onSkeletonChanged);
|
||||||
|
|
||||||
isAppActive = false;
|
isAppActive = false;
|
||||||
updateHandControllerGrab();
|
updateHandControllerGrab();
|
||||||
|
|
||||||
if (!tablet) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (button) {
|
if (button) {
|
||||||
button.clicked.disconnect(onAppButtonClicked);
|
button.clicked.disconnect(onAppButtonClicked);
|
||||||
|
|
Loading…
Reference in a new issue