repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 0468f0d4f10112a3c8a6a46f78cddd0fe2d53963:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 0468f0d4f10112a3c8a6a46f78cddd0fe2d53963
Author: James Baicoianu 
Date:   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
index 31b05fefc6d974e701cf0808e75b7a2ee8fa36e7..
index ..575d54ff0cf8227cca458d9007684d17e7167b0a 100644
--- 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-----