going to destroy entire page and recreate

This commit is contained in:
ericrius1 2016-02-01 14:46:09 -08:00
parent 81f95c6fc7
commit 0bd6d22611
2 changed files with 14 additions and 12 deletions

View file

@ -1884,6 +1884,7 @@ var showMenuItem = propertyMenu.addMenuItem("Show in Marketplace");
propertiesTool = PropertiesTool();
var particleExplorerTool = ParticleExplorerTool();
particleExplorerTool.createWebView();
entityListTool.webView.eventBridge.webEventReceived.connect(function(data) {
var data = JSON.parse(data);
if (data.type == "selectionUpdate") {

View file

@ -3,25 +3,26 @@ var PARTICLE_EXPLORER_HTML_URL = Script.resolvePath('particleExplorer.html');
ParticleExplorerTool = function() {
var that = {};
var url = PARTICLE_EXPLORER_HTML_URL;
var webView = new OverlayWebWindow({
title: 'Particle Explorer',
source: url,
toolWindow: true
});
that.createWebView = function() {
var url = PARTICLE_EXPLORER_HTML_URL;
that.webView = new OverlayWebWindow({
title: 'Particle Explorer',
source: url,
toolWindow: true
});
var visible = false;
webView.setVisible(visible);
that.webView = webView;
var visible = false;
that.webView.setVisible(visible);
that.webView.eventBridge.webEventReceived.connect(that.webEventReceived);
}
var webEventReceived = function(data) {
that.webEventReceived = function(data) {
var data = JSON.parse(data);
if (data.messageType === "settings_update") {
Entities.editEntity(that.activeParticleEntity, data.updatedSettings);
}
print("EBL WEB EVENT RECIEVED FROM PARTICLE GUI");
}
webView.eventBridge.webEventReceived.connect(webEventReceived);
that.setActiveParticleEntity = function(id) {
that.activeParticleEntity = id;
@ -29,7 +30,7 @@ ParticleExplorerTool = function() {
that.setVisible = function(newVisible) {
visible = newVisible;
webView.setVisible(visible);
that.webView.setVisible(visible);
}
return that;