Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
KTRosenberg committed Jan 24, 2020
1 parent 77d9f25 commit a27724f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,5 @@ typings/
.dynamodb/

*.DS_Store

*.mrconf.*
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<!-- System Initialization -->
<!-- System Version Number -->
<div id='version' value='1'></div>
<div id='version' value='2'></div>
<div id='resolution' value='640,640'></div>
<div id='server-comm-port' value='3001'></div>
<div id='server-sync-port' value='11234'></div>
Expand Down
5 changes: 5 additions & 0 deletions lib/core/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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); });
Expand Down
13 changes: 12 additions & 1 deletion lib/core/webxr_profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand All @@ -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);
Expand All @@ -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();
Expand Down

0 comments on commit a27724f

Please sign in to comment.