in progress

This commit is contained in:
ericrius1 2016-01-28 16:38:24 -08:00
parent 804f82f2f1
commit 1a7887520d
5 changed files with 17 additions and 22 deletions

View file

@ -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",
]);

View file

@ -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) {

View file

@ -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!");
}
});

View file

@ -18,7 +18,7 @@
<script type="text/javascript" src="underscore-min.js"></script>
<script type="text/javascript" src="qrc:///qtwebchannel/qwebchannel.js"></script>
<script type="text/javascript" src="../html/eventBridgeLoader.js"></script>
<script type="text/javascript" src="main.js?1234"></script>
<script type="text/javascript" src="main.js?132112"></script>
<script>
</script>
<style>

View file

@ -1,4 +1,4 @@
var PARTICLE_EXPLORER_HTML_URL = Script.resolvePath('particleExplorer.html');
var PARTICLE_EXPLORER_HTML_URL = Script.resolvePath('particleExplorer.html?v1' + Math.random());
ParticleExplorerTool = function() {
var that = {};
@ -11,10 +11,19 @@ ParticleExplorerTool = function() {
var visible = false;
webView.setVisible(visible);
webView.eventBridge.webEventReceived.connect(function(data) {
print("EBL GOT AN EVENT!");
});
that.setVisible = function(newVisible) {
visible = newVisible;
webView.setVisible(visible);
}
that.getWebView = function() {
return webView;
}
};