diff --git a/.gitignore b/.gitignore index c6c3efe..54172ea 100644 --- a/.gitignore +++ b/.gitignore @@ -84,3 +84,5 @@ typings/ .dynamodb/ *.DS_Store + +*.mrconf.* diff --git a/index.html b/index.html index 6707400..913a004 100644 --- a/index.html +++ b/index.html @@ -23,7 +23,7 @@ -
+ diff --git a/lib/core/run.js b/lib/core/run.js index a0e1895..b9c3938 100644 --- a/lib/core/run.js +++ b/lib/core/run.js @@ -36,6 +36,10 @@ window.treq = function (data) { function rawURL(url) { return url.split(/[?#]/)[0]; } + +function updateWorld(world) { + MR.worlds[MR.worldIdx].world = world; +} window.hotReloadFile = function(localPath) { const parentPath = path.getCurrentPath(window.location.pathname); @@ -66,6 +70,7 @@ window.hotReloadFile = function(localPath) { MR.engine.reloadGeneration; import(importName).then( (world) => { + updateWorld(world); const conf = world.default(); MR.engine.onReload(conf); }).catch(err => { console.error(err); }); diff --git a/lib/core/webxr_profile.js b/lib/core/webxr_profile.js index 88fdeab..49dfeba 100644 --- a/lib/core/webxr_profile.js +++ b/lib/core/webxr_profile.js @@ -7,6 +7,7 @@ import {ShaderTextEditor} from "/lib/core/shader_text_editor.js"; import * as canvasutil from "/lib/util/canvas.js"; import * as path from "/lib/util/path.js"; import * as errs from "/lib/core/error_handler.js"; +import * as assetutil from "/lib/util/asset.js"; export default class WebXRProfile extends Profile { constructor(){ @@ -18,6 +19,16 @@ export default class WebXRProfile extends Profile { this.sourceFiles = document.getElementsByClassName("worlds"); let worldIt = this.sourceFiles[0].firstElementChild; while (worldIt !== null) { + // { + // console.log("WEE") + // const W = await import("/worlds/week10/week10.js"); + // console.log(W, W.default()); + // const conf = await assetutil.loadTextAbsolutePath("/locallib/wee.mrconf.json"); + // console.log(conf); + // console.log("HUH") + + + // } const src = worldIt.src; console.log("loading world: %s", src); const world = await import(src); @@ -32,7 +43,7 @@ export default class WebXRProfile extends Profile { } } - async main(){ + async main() { { const ui = await import("../ui/default_window_ui.js"); MR.engine.ui = new ui.DefaultWindowMenuUI();