mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-23 10:04:00 +02:00
trying to destroy web window
This commit is contained in:
parent
0bd6d22611
commit
25d5904d2d
2 changed files with 11 additions and 10 deletions
|
@ -1884,7 +1884,6 @@ var showMenuItem = propertyMenu.addMenuItem("Show in Marketplace");
|
||||||
|
|
||||||
propertiesTool = PropertiesTool();
|
propertiesTool = PropertiesTool();
|
||||||
var particleExplorerTool = ParticleExplorerTool();
|
var particleExplorerTool = ParticleExplorerTool();
|
||||||
particleExplorerTool.createWebView();
|
|
||||||
entityListTool.webView.eventBridge.webEventReceived.connect(function(data) {
|
entityListTool.webView.eventBridge.webEventReceived.connect(function(data) {
|
||||||
var data = JSON.parse(data);
|
var data = JSON.parse(data);
|
||||||
if (data.type == "selectionUpdate") {
|
if (data.type == "selectionUpdate") {
|
||||||
|
@ -1892,19 +1891,19 @@ entityListTool.webView.eventBridge.webEventReceived.connect(function(data) {
|
||||||
if(ids.length === 1) {
|
if(ids.length === 1) {
|
||||||
if (Entities.getEntityProperties(ids[0], "type").type === "ParticleEffect") {
|
if (Entities.getEntityProperties(ids[0], "type").type === "ParticleEffect") {
|
||||||
// Now we want to activate the partice explorer panel!
|
// Now we want to activate the partice explorer panel!
|
||||||
|
particleExplorerTool.createWebView();
|
||||||
print("EBL ACTIVATE PARTICLE EXPLORER");
|
print("EBL ACTIVATE PARTICLE EXPLORER");
|
||||||
particleExplorerTool.setVisible(true);
|
|
||||||
var properties = Entities.getEntityProperties(ids[0]);
|
var properties = Entities.getEntityProperties(ids[0]);
|
||||||
var data = {
|
var data = {
|
||||||
messageType: "particle_settings",
|
messageType: "particle_settings",
|
||||||
currentProperties: properties
|
currentProperties: properties
|
||||||
};
|
};
|
||||||
|
|
||||||
particleExplorerTool.setActiveParticleEntity(ids[0]);
|
particleExplorerTool.setActiveParticleEntity(ids[0]);
|
||||||
particleExplorerTool.webView.eventBridge.emitScriptEvent(JSON.stringify(data));
|
particleExplorerTool.webView.eventBridge.emitScriptEvent(JSON.stringify(data));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
particleExplorerTool.setVisible(false);
|
print("EBL CLOSE WEB VIEW")
|
||||||
|
particleExplorerTool.destroyWebView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,11 +11,17 @@ ParticleExplorerTool = function() {
|
||||||
toolWindow: true
|
toolWindow: true
|
||||||
});
|
});
|
||||||
|
|
||||||
var visible = false;
|
that.webView.setVisible(true);
|
||||||
that.webView.setVisible(visible);
|
|
||||||
that.webView.eventBridge.webEventReceived.connect(that.webEventReceived);
|
that.webView.eventBridge.webEventReceived.connect(that.webEventReceived);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
that.destroyWebView = function() {
|
||||||
|
print("EBL DESTROY WEB VIEW" + that.webView);
|
||||||
|
that.webView.close();
|
||||||
|
that.webView = null;
|
||||||
|
}
|
||||||
|
|
||||||
that.webEventReceived = function(data) {
|
that.webEventReceived = function(data) {
|
||||||
var data = JSON.parse(data);
|
var data = JSON.parse(data);
|
||||||
if (data.messageType === "settings_update") {
|
if (data.messageType === "settings_update") {
|
||||||
|
@ -28,10 +34,6 @@ ParticleExplorerTool = function() {
|
||||||
that.activeParticleEntity = id;
|
that.activeParticleEntity = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
that.setVisible = function(newVisible) {
|
|
||||||
visible = newVisible;
|
|
||||||
that.webView.setVisible(visible);
|
|
||||||
}
|
|
||||||
|
|
||||||
return that;
|
return that;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue