From 1a7887520d7076a775ef566719d401c42beda6d5 Mon Sep 17 00:00:00 2001 From: ericrius1 Date: Thu, 28 Jan 2016 16:38:24 -0800 Subject: [PATCH] in progress --- examples/edit.js | 2 +- examples/libraries/entityList.js | 19 ++----------------- examples/particle_explorer/main.js | 5 +++-- .../particle_explorer/particleExplorer.html | 2 +- .../particle_explorer/particleExplorerTool.js | 11 ++++++++++- 5 files changed, 17 insertions(+), 22 deletions(-) diff --git a/examples/edit.js b/examples/edit.js index 7ee56ba1d0..503c90d248 100644 --- a/examples/edit.js +++ b/examples/edit.js @@ -27,7 +27,7 @@ Script.include([ "libraries/entityCameraTool.js", "libraries/gridTool.js", "libraries/entityList.js", - "particle_explorer/particleExplorerTool.js", + "particle_explorer/particleExplorerTool.js?v1" + Math.random(), "libraries/lightOverlayManager.js", ]); diff --git a/examples/libraries/entityList.js b/examples/libraries/entityList.js index aeb8226061..588568c857 100644 --- a/examples/libraries/entityList.js +++ b/examples/libraries/entityList.js @@ -8,6 +8,8 @@ EntityListTool = function(opts) { title: 'Entities', source: url, toolWindow: true }); + + var searchRadius = 100; var visible = false; @@ -71,31 +73,14 @@ EntityListTool = function(opts) { webView.eventBridge.emitScriptEvent(JSON.stringify(data)); } - that.enableParticleTab = function(entityID) { - var data = { - type: "enableParticleTab", - entity: entityID - }; - webView.eventBridge.emitScriptEvent(JSON.stringify(data)); - } webView.eventBridge.webEventReceived.connect(function(data) { data = JSON.parse(data); if (data.type == "selectionUpdate") { - print("EBL CLICKED ON SOME SHIT " + JSON.stringify(data)) var ids = data.entityIds; var entityIDs = []; for (var i = 0; i < ids.length; i++) { entityIDs.push(ids[i]); - } - if (entityIDs.length === 1) { - //We selected just one entity, so see if that entity is a particle entity - var type = Entities.getEntityProperties(entityIDs[0], "type").type; - if (type === "ParticleEffect") { - that.enableParticleTab(entityIDs[0]); - } - - } selectionManager.setSelections(entityIDs); if (data.focus) { diff --git a/examples/particle_explorer/main.js b/examples/particle_explorer/main.js index c76eef42af..a8922acb9f 100644 --- a/examples/particle_explorer/main.js +++ b/examples/particle_explorer/main.js @@ -339,6 +339,7 @@ function writeVec3ToInterface(obj) { } function listenForSettingsUpdates() { + console.log("EBL sLISTENING FOR EVENTS") EventBridge.scriptEventReceived.connect(function(data) { data = JSON.parse(data); if (data.messageType === 'initial_settings') { @@ -349,8 +350,8 @@ function listenForSettingsUpdates() { loadGUI(); } - - if (date.type === "enableParticleTab") { + console.log("EBL RECIEVED EVENT - " + JSON.stringify(data)); + if (data.type === "enableParticleTab") { console.log("EBL JUST GOT AN ENABLE MESSAGE!"); } }); diff --git a/examples/particle_explorer/particleExplorer.html b/examples/particle_explorer/particleExplorer.html index b50d100934..c187df7e6d 100644 --- a/examples/particle_explorer/particleExplorer.html +++ b/examples/particle_explorer/particleExplorer.html @@ -18,7 +18,7 @@ - +