mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 08:14:48 +02:00
better fix
This commit is contained in:
parent
df4d81277f
commit
1cc95fbf76
2 changed files with 14 additions and 7 deletions
|
@ -82,19 +82,17 @@ function calcSpawnInfo(hand, landscape) {
|
|||
}
|
||||
|
||||
|
||||
function cleanUpOldMaterialEntities() {
|
||||
cleanUpOldMaterialEntities = function() {
|
||||
var avatarEntityData = MyAvatar.getAvatarEntityData();
|
||||
|
||||
for (var entityID in avatarEntityData) {
|
||||
var entityName = Entities.getEntityProperties(entityID, ["name"]).name;
|
||||
|
||||
if (entityName === TABLET_MATERIAL_ENTITY_NAME) {
|
||||
if (entityName === TABLET_MATERIAL_ENTITY_NAME && entityID !== HMD.homeButtonHighlightMaterialID &&
|
||||
entityID !== HMD.homeButtonUnhighlightMaterialID) {
|
||||
Entities.deleteEntity(entityID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cleanUpOldMaterialEntities();
|
||||
};
|
||||
|
||||
/**
|
||||
* WebTablet
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
//
|
||||
|
||||
/* global Script, HMD, WebTablet, UIWebTablet, UserActivityLogger, Settings, Entities, Messages, Tablet, Overlays,
|
||||
MyAvatar, Menu, AvatarInputs, Vec3 */
|
||||
MyAvatar, Menu, AvatarInputs, Vec3, cleanUpOldMaterialEntities */
|
||||
|
||||
(function() { // BEGIN LOCAL_SCOPE
|
||||
var tabletRezzed = false;
|
||||
|
@ -31,6 +31,14 @@
|
|||
|
||||
Script.include("../libraries/WebTablet.js");
|
||||
|
||||
function cleanupMaterialEntities() {
|
||||
if (Window.isPhysicsEnabled()) {
|
||||
cleanUpOldMaterialEntities();
|
||||
return;
|
||||
}
|
||||
Script.setTimeout(cleanupMaterialEntities, 100);
|
||||
}
|
||||
|
||||
function checkTablet() {
|
||||
if (gTablet === null) {
|
||||
gTablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||
|
@ -327,4 +335,5 @@
|
|||
HMD.homeButtonHighlightMaterialID = null;
|
||||
HMD.homeButtonUnhighlightMaterialID = null;
|
||||
});
|
||||
Script.setTimeout(cleanupMaterialEntities, 100);
|
||||
}()); // END LOCAL_SCOPE
|
||||
|
|
Loading…
Reference in a new issue