mirror of
https://github.com/overte-org/overte.git
synced 2025-04-30 16:22:50 +02:00
41 lines
No EOL
1.1 KiB
JavaScript
41 lines
No EOL
1.1 KiB
JavaScript
var PARTICLE_EXPLORER_HTML_URL = Script.resolvePath('particleExplorer.html');
|
|
|
|
ParticleExplorerTool = function() {
|
|
var that = {};
|
|
|
|
that.createWebView = function() {
|
|
var url = PARTICLE_EXPLORER_HTML_URL;
|
|
that.webView = new OverlayWebWindow({
|
|
title: 'Particle Explorer',
|
|
source: url,
|
|
toolWindow: true
|
|
});
|
|
|
|
that.webView.setVisible(true);
|
|
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) {
|
|
var data = JSON.parse(data);
|
|
if (data.messageType === "settings_update") {
|
|
Entities.editEntity(that.activeParticleEntity, data.updatedSettings);
|
|
}
|
|
print("EBL WEB EVENT RECIEVED FROM PARTICLE GUI");
|
|
}
|
|
|
|
that.setActiveParticleEntity = function(id) {
|
|
that.activeParticleEntity = id;
|
|
}
|
|
|
|
|
|
return that;
|
|
|
|
|
|
}; |