repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 976bd2d923b37da7baa4a47a7c1161e26a7d3707:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 976bd2d923b37da7baa4a47a7c1161e26a7d3707
Author: James Baicoianu 
Date:   Thu Oct 19 20:48:18 2017 -0700

    Improved hierarchical asset handling

diff --git a/scripts/janusweb.js b/scripts/janusweb.js
index 970d66a1dcf2b67cd6bc52a5bffe67728dbdccc1..
index ..aa3c48a6994a0a4078e283812bb051ded570458c 100644
--- a/scripts/janusweb.js
+++ b/scripts/janusweb.js
@@ -75,7 +75,7 @@ elation.require(['janusweb.config', 'engine.things.generic','janusweb.remoteplay
       if (this.corsproxy != '') {
         elation.engine.assets.setCORSProxy(this.corsproxy);
       }
-      elation.engine.assets.loadAssetPack(this.properties.datapath + 'assets.json', this.properties.datapath);
+      this.assetpack = elation.engine.assets.loadAssetPack(this.properties.datapath + 'assets.json', this.properties.datapath);
       this.parser = new JanusFireboxParser();
       this.scriptingInitialized = false;

@@ -557,5 +557,12 @@ console.log('Register new SYSTEM tag type:', tagname, classobj, extendclass);
         };
       }
     }
+    this.getAsset = function(type, name, assetargs) {
+      var asset;
+      if (this.assetpack) {
+        asset = this.assetpack.get(type, name, assetargs);
+      }
+      return asset;
+    }
   }, elation.engine.things.generic);
 });

-----END OF PAGE-----