mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 18:03:27 +02:00
improve actionInspector.js
This commit is contained in:
parent
96d0df49e4
commit
898e3917e3
1 changed files with 20 additions and 1 deletions
|
@ -120,8 +120,27 @@ Script.setInterval(function() {
|
||||||
if (actionText != "") {
|
if (actionText != "") {
|
||||||
updateOverlay(entityID, actionText);
|
updateOverlay(entityID, actionText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if an entity no longer has an action, remove its overlay
|
||||||
|
if (actionIDs.length == 0) {
|
||||||
|
if (entityID in overlays) {
|
||||||
|
Overlays.deleteOverlay(overlays[entityID]);
|
||||||
|
delete overlays[entityID];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
|
// if an entity is too far away, remove its overlay
|
||||||
|
for (var entityID in overlays) {
|
||||||
|
var position = Entities.getEntityProperties(entityID, ["position"]).position;
|
||||||
|
if (Vec3.distance(position, MyAvatar.position) > INSPECT_RADIUS) {
|
||||||
|
Overlays.deleteOverlay(overlays[entityID]);
|
||||||
|
delete overlays[entityID];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}, 100);
|
||||||
|
|
||||||
|
|
||||||
Script.scriptEnding.connect(cleanup);
|
Script.scriptEnding.connect(cleanup);
|
||||||
|
|
Loading…
Reference in a new issue