repo: janusweb action: commit revision: path_from: revision_from: 0468f0d4f10112a3c8a6a46f78cddd0fe2d53963: path_to: revision_to:
commit 0468f0d4f10112a3c8a6a46f78cddd0fe2d53963 Author: James BaicoianuDate: Sun Jan 30 13:55:52 2022 -0800 Added object.static attribute to bypass script updates diff --git a/scripts/janusbase.js b/scripts/janusbase.js
--- a/scripts/janusbase.js
+++ b/scripts/janusbase.js
@@ -51,6 +51,7 @@ elation.require(['engine.things.generic', 'utils.template', 'janusweb.parts'], f
billboard: { type: 'string', default: '' },
hasposition: { type: 'boolean', default: true },
gazetime: { type: 'float' },
+ static: { type: 'boolean', default: false },
ongazeenter: { type: 'callback' },
ongazeleave: { type: 'callback' },
ongazeprogress: { type: 'callback' },
@@ -719,7 +720,11 @@ elation.require(['engine.things.generic', 'utils.template', 'janusweb.parts'], f
}
this.start = function() {
if (!this.started) {
- elation.events.add(this.room, 'janusweb_script_frame_end', this.handleFrameUpdates);
+ if (!this.static) {
+ elation.events.add(this.room, 'janusweb_script_frame_end', this.handleFrameUpdates);
+ } else {
+ this.handleFrameUpdates({data: {dt: 0}});
+ }
this.started = true;
}
for (var k in this.children) {
@@ -736,7 +741,9 @@ elation.require(['engine.things.generic', 'utils.template', 'janusweb.parts'], f
}
}
if (this.started) {
- elation.events.remove(this.room, 'janusweb_script_frame_end', this.handleFrameUpdates);
+ if (!this.static) {
+ elation.events.remove(this.room, 'janusweb_script_frame_end', this.handleFrameUpdates);
+ }
this.started = false;
this.dispatchEvent({type: 'stop', bubbles: false});
}
-----END OF PAGE-----